Omirion Docs

VWS API Authentication & Upload

This guide explains how to authenticate and upload data to the VWS API using terminal commands.

This guide explains how to authenticate and upload data to the VWS API using terminal commands.

Default :

USERNAME: Moduliser.admin

PWD: Moduliser_123!

Prerequisites

  • curl installed
  • jq installed (for JSON parsing)
  • A valid VWS account

1. Get the authentication token

# Replace USERNAME and PASSWORD with your VWS credentials
curl -s -X POST 'https://reportanalysis.smartviser-vws.com/api/user/login' \
  -H 'Content-Type: application/json' \
  -d '{"username": "USERNAME", "password": "PASSWORD"}'

Expected response:

{"token": "f674a721-4b6b-4e85-b786-fc2f91aefa00", "id": 123}

Extract only the token

TOKEN=$(curl -s -X POST 'https://reportanalysis.smartviser-vws.com/api/user/login' \
  -H 'Content-Type: application/json' \
  -d '{"username": "USERNAME", "password": "PASSWORD"}' | jq -r '.token')

echo $TOKEN

2. Upload a results file

# Replace TOKEN with your token and PATH_TO_FILE with the path to the JSON file
curl -X POST 'https://reportanalysis.smartviser-vws.com/api/testplan' \
  -H 'Content-Type: application/json' \
  -H 'authentication: TOKEN' \
  -d @PATH_TO_FILE.json

Complete example in one command

# Login and upload in a single command
TOKEN=$(curl -s -X POST 'https://reportanalysis.smartviser-vws.com/api/user/login' \
  -H 'Content-Type: application/json' \
  -d '{"username": "USERNAME", "password": "PASSWORD"}' | jq -r '.token') && \
curl -X POST 'https://reportanalysis.smartviser-vws.com/api/testplan' \
  -H 'Content-Type: application/json' \
  -H "authentication: $TOKEN" \
  -d @moduliser_output.json

3. Check the upload status

The curl command returns the HTTP code. To display it:

curl -s -o /dev/null -w "%{http_code}" -X POST 'https://reportanalysis.smartviser-vws.com/api/testplan' \
  -H 'Content-Type: application/json' \
  -H "authentication: $TOKEN" \
  -d @moduliser_output.json
  • 200: Upload successful
  • 401: Invalid or expired token
  • 400: Invalid JSON format

4. View the results

Once the upload is complete, the data is available at:

https://smartviser-vws.com/analytics_studio/

On this page