Auth
getAuthCode
Obtain System AuthCode to get System rights token,This method can use the following parameters.
Request:
MODERATOR example
{
"user_id": "unique_id",
"name":"name",
"role":"MODERATOR"
}
PUBLISHER example
{
"user_id": "unique_id",
"name":"name",
"role":"PUBLISHER"
}
Parameter | Meaning | Type | Required | Default value | Description |
---|---|---|---|---|---|
HEADERS | |||||
Content-Type | string | Y | application/json | ||
arc-license-key | key | string | Y | ||
BODY | |||||
user_id | unique_id for user account | string | Y | Please fill in a unique identifiable value. | |
name | name | string | N | If a display name is not provided, a random string will be used. | |
example:USER-12345678 | |||||
role | Role of the Logged-in User | string | Y | This endpoint allows users to log in as a participant.There two roles to choose, MODERATOR or PUBLISHER ADMIN SWITCH CLIENT |
Response:
{
"status": 1,
"message": "",
"info": {
"code":"XXXXXXXXXXXXXXXXXXXX"
}
}
Parameter | Meaning | Type | Existed | Default value | Description |
---|---|---|---|---|---|
BODY | |||||
status | response status | string | Y | 0: fail | |
1: success | |||||
2: warning | |||||
message | message | string | Y | “” | Error messages should be shown when there are errors. |
info | Return Information | object | |||
code | User Authentication Code | string | use this code to get token |
Error code:
The following is a table of error messages returned by the API.
Code | Status | Error | Message |
---|---|---|---|
200 | 1 | success | |
0 | Unauthorized Access | ||
404 | Resource Not Found | ||
403 | Access to the requested resource is not allowed |
getAuthTokenUseCode
Use getAuthCode
to obtain a token. Please call getAuthTokenUseCode
within ten minutes, or the code will expire.This API provides an authentication token upon successful login.
Request:
example
{
"grant_type":"authorization_code",
"client_id":"arctos-webapp",
"code":"XXXXXXXXXXX",
"redirect_uri":"https://XXXXX.XXX.XXX"
}
Parameter | Meaning | Type | Required | Default value | Description |
---|---|---|---|---|---|
HEADERS | |||||
Content-Type | string | Y | application/json | ||
BODY | |||||
grant_type | Authorization Type Requested by Client | string | Y | This parameter is used to specify the grant type. | |
client_id | Source of Customer | string | Y | webapp_user | arctos-webapp:browser |
arctos-switch:moderator_device | |||||
arctos-client:publisher_device | |||||
code | account | string | Y | Please fill in a unique identifiable value. | |
redirect_uri | string | N | The page that will be returned |
Response:
{
"status": 1,
"message": "",
"info": {
"user_id": 1010000010,
"access_token": "eyJ0eXAiOiJKV1QiLCXXXXXXXXX"
}
}
Parameter | Meaning | Type | Existed | Default value | Description |
---|---|---|---|---|---|
BODY | |||||
status | response status | string | Y | 0: fail | |
1: success | |||||
2: warning | |||||
message | message | string | Y | “” | Error messages should be shown when there are errors. |
info | Return Information | object | |||
user_id | userID in ihh | number | Y | ||
access_token | User Authentication Token | string | Y |
Error code:
The following is a table of error messages returned by the API.
Code | Status | Error | Message |
---|---|---|---|
200 | 1 | success | |
0 | Unauthorized Access | ||
404 | Resource Not Found | ||
403 | Access to the requested resource is not allowed |
checkAuthToken
Verify and check if the user's access_token
authorization is valid.
Request:
example
{
}
Parameter | Meaning | Type | Required | Default value | Description |
---|---|---|---|---|---|
HEADERS | |||||
Content-Type | string | Y | application/json | ||
Authorization | string | Y | Bearer | ||
BODY | |||||
Response:
{
"status": 1,
"message": "",
"info": {
// decode from token
"client_id": "arctos-switch",
"user_id": 1010000006,
"role": "SWITCH"
}
}
Parameter | Meaning | Type | Existed | Default value | Description |
---|---|---|---|---|---|
BODY | |||||
status | response status | string | Y | 0: fail | |
1: success | |||||
2: warning | |||||
message | message | string | Y | “” | Error messages should be shown when there are errors. |
info | Return Information | object | |||
client_id | User’s jwt client_id | string | Y | “” | |
user_id | User’s jwt user_id | string | Y | “” | |
role | User’s jwt role | string | Y | “GUSET” | |
license_room | number | Y | |||
license_path | string | Y |
Error code:
The following is a table of error messages returned by the API.
Code | Status | Error | Message |
---|---|---|---|
200 | 1 | success | |
0 | Unauthorized Access | ||
401 | 1401 | Authorization is null | |
1402 | Authorization type is incorrect | ||
1403 | Unauthorized | ||
1404 | Token has expired | ||
1405 | Token is invalid | ||
404 | Resource Not Found | ||
403 | 3401 | License file is not found | |
3402 | License file type is incorrect | ||
3403 | Unauthorized | ||
3404 | License has expired | ||
3405 | License room out of limit | ||