POST - /token

General Information


ServiceAPIMethodData ModelsWorkflow
oauth/tokenPOSTN/AN/A

Description 

This API allows the user to login and create an access and refresh token.

Input


Type: application/json
NameSourceMandatoryTypeSpecial FormatDescription
usernameBodyNOStringN/AUsername
passwordBodyNOStringN/APassword
grant_typeBodyYESString

"enum": ["refresh_token", "password"]

Grant Type
refresh_tokenBodyNOStringN/ARefresh token

Output


Response

SOAJS has a unified response. Check out this link to understand more the schema of SOAJS response 

Valid Response

Valid Response Sample
{
    "token_type": "bearer",
    "access_token": "%oauth_access_token_value%",
    "expires_in": 3600,
    "refresh_token": "%oauth_refresh_token_value%"
}

Invalid Response

Error Response Sample
{
    "result":false,
    "errors":{
        "codes":[406],
        "details":[
            {
                "code":406,
                "message":"Missing Tenant secret"
            }
        ]
    }
}


SOAJS Error Codes


Code
Description
406

Missing Tenant secret

414

Local login is not allowed

503

You do not have privileges to enable pin login

503

Unable to log in the user. User not found