Authentication
An authentication token must be included in all REST API calls using the bearer token parameter.
You can get a token using any REST client. For sample code to get a token using Java, PHP, .NET, Python, Ruby, and other languages.
1. Request Token Method (auth/login)
This method will allow to create a token to interact with the API
URL
| Server |
URL |
HTTP type |
| UAT |
https://api-ca-uat.iinsightonline.com/auth/login |
POST |
| PRODUCTION |
https://api-ca.iinsightonline.com/auth/login |
POST |
Authorization
| Parameter |
Value |
Mandatory |
| Type |
Basic Auth |
Yes |
| Username (Client ID) |
(generated on iinsight platform) |
Yes |
| Password (Client secret) |
(generated on iinsight platform) |
Yes |
Body (form-data)
| Parameter |
Value |
Mandatory |
| grant_type |
password |
Yes |
| username |
(It's an iinsight user) |
Yes |
| password |
(iinsight user's password) |
Yes |
Response
{
"access_token": "9fb568867f4167ecf1fd24785dac26dde9e1c8f4",
"expires_in": 3600,
"token_type": "Bearer",
"scope": null,
"refresh_token": "bf4416933952d146614d5f539c25811f9045e33f"
}
2. Refresh Token Method (auth/refresh)
This method will allow to create a new token to interact with the API when the previous token had expired.
URL
| Server |
URL |
HTTP type |
| UAT |
https://api-ca-uat.iinsightonline.com/auth/refresh |
POST |
| PRODUCTION |
https://api-ca.iinsightonline.com/auth/refresh |
POST |
Authorization
| Parameter |
Value |
Mandatory |
| Type |
Basic Auth |
Yes |
| Username (Client ID) |
(generated on iinsight platform) |
Yes |
| Password (Client secret) |
(generated on iinsight platform) |
Yes |
Body (form-data)
| Parameter |
Value |
Mandatory |
| grant_type |
refresh_token |
Yes |
| refresh_token |
The refresh token prvided in the /auth/login method |
Yes |
Response
{
"access_token": "1c8f64974ba31f694d390d671e5018ca06ad4e80",
"expires_in": 3600,
"token_type": "Bearer",
"scope": null,
"refresh_token": "be7064b58e565466fc06ea148325088fef23429e"
}