The first call to Violet that needs to be made is the /login call, to authenticate your Violet Account and credentials and retrieve an authentication token. This token stays valid for 24 hours before a new one needs to be generated.

POST /login

Log in to your Violet Application and retrieve an authentication token

Request

Body

username

Username for your Violet account created on channel.violet.io (this is your email you signed up with)

password

Password for your Violet account you created on channel.violet.io

While the User Management feature of the Dashboard allows multiple users to login and view the dashboard, only an App’s “Owner” username and password will allow you to generate a token. You can view who your App’s owner is on the team view

Curl
curl -X POST https://sandbox-api.violet.io/v1/login \
-H "X-Violet-App-Id: your-app-id-here" \
-H "X-Violet-App-Secret: your-app-secret-here" \
-H "Content-type: application/json" \
-d '{"username": "your-username-here", "password": "your-password-here"}'

Response

This method returns a refersh token along with other information about your Violet Account. Since you’re logging in, we know your credentials are good, so we send over a token at the same time. This token is a JWT token that is used to authenticate each request to the Violet API. You can use this token, however it will need to be refreshed. See below for where you can expect to find the refresh token and the token upon initial login.

JSON
{
    "id": 10000,
    "first_name": "",
    "last_name": "",
    "password":,
    "email": "",
    "type": "",
    "verified": false,
    "status": null,
    "date_created": "",
    "date_last_modified": "",
    "roles": [],
    "tos_accepted": true,
    "payment_configured": null,
    "token": "",
    "refresh_token": "",
    "merchant_id": null,
    "store_url": null
}