NoteFor more details, see the Communication, Authentication and Authorization in CTC PDF.
Obtaining an access_token
access_tokenSend a POST request to the token_endpoint with the following parameters in the request body:
grant_type: passwordusername: the user's usernamepassword: the user's passwordclient_id: your client IDscope: the requested scopes, such asopenidandprofile
CTC-US
token_endpoint: https://accounts.calamp.com/oauth2/aus190umwbX0NIZv65d6/v1/token
client_id: 0oa63qnii6kCc10Ze5d7
CTC-EU
token_endpoint: https://accounts.calamp.co.uk/oauth2/aus9s1fokCpJoN3jB416/v1/token
client_id: 0oa6snpq4eh3BdzxI417
Example:
curl -X POST https://accounts.calamp.com/oauth2/aus190umwbX0NIZv65d6/v1/token \
-d grant_type=password \
-d username=your-username \
-d password=your-password \
-d client_id=0oa63qnii612345 \
-d scope=openidThe Authorization Server will respond with an access_token in the response body.
{
"token_type": "Bearer",
"expires_in": 86400,
"access_token": "eyJraWQiOiJ0VD...mcaYWQ",
"scope": "openid",
"id_token": "eyJraWQiOiJ...wpdZg"
}
NoteThe
access_tokenexpires in 24 hours at which time a newaccess_tokenneeds to be obtained via the authentication process described.
