Back to top

Step 1 — Get access token

Last updated June 26th, 2024

You can call the POST /oauth2/token operation, using your app’s client ID and client secret, to get the access token.

The expiration period for an access token is 10 minutes.

The following request format is used to get an access token using client credentials:

curl 
--location 'https://api.samsungknox.com/ams/v1/oauth2/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id={OAUTH2_CLIENT_ID}' \
--data-urlencode 'client_secret={OAUTH2_CLIENT_SECRET}' \
--data-urlencode 'scope={Required Scope}'

For example:

curl 
--location 'https://api.samsungknox.com/ams/v1/oauth2/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id=u6oBxBP53rkCoqDpkzvgNtnUwsFw5mrs' \
--data-urlencode 'client_secret=AQCGAt6Py7w1ixpksRKUzhAg99AzVoGN' \
--data-urlencode 'scope=ke'

You receive the access token in the following format. The value of the expires_in key denotes the number of seconds for which the access token is valid. You need an active access token every time you make Knox cloud services API call.

{
  "access_token":"eyJhbGc..SbHWvZ1w",
  "scope":"ke",
  "expires_in": 599,
  "token_type":"Bearer"
}

Is this page helpful?