The Vicotee API requires API token on each requests. Obtain the API token by authenticating with your username and API password. You can view and manage your API passwords from User Profile.
To help keep your information secure, we highly recommend setting an expiration for your API passwords.
Once you have an API password, you can use Authentication API to obtain API token. This done as follow:
Do not use your personal password to obtain the API token. Always use API password.
Authentication request |
---|
|
Response JSON |
---|
|
Your API Token |
---|
You need to extract token from the JSON response and use it in 'Authorization' header to call API requests. NOTE: The token is valid for 60 minutes. Once the token is expired, you need to request new one through Authentication API. Here is an example of using the token to retrieve information about device (566700000000009c):
|
API requests using token generated by your username and API password will return that token's expiration date via the X-Token-Expiration header. Use this header to decide if you need to request new API token. To increase performance of your scripts or applications, you shouldn't request new API token for every API calls. It is best to only request a new API token when it has expired.
In addition to X-Token-Expiration, you will also find X-API-Password-Expiration header. You can use this header in your scripts or applications to provide a warning message then the API password is about to expire. You can not request new API token once the API password has expired.