Generate SSO token

This API call generates a token that allows you to execute update package download URLs.

Endpoint

/public/v1.0/oauth/api-token

Parameter

Parameter Type Description In Required
body body optional

Body format

The TokenGrantCredentialsDto object

Element Type Description Required
clientId string optional
clientSecret string optional
scope string optional

Response

Response codes

Code Description
200

Token generated successfully

401

Invalid credentials

404

Cluster not found

Response body

A successful request doesn't return any content.

Example

In this example, you generate a token execute following REST call:

Curl

curl -X POST "https://mcsvc.dynatrace.com/rest/public/v1.0/oauth/api-token" 
-H "accept: application/json" 
-H "Content-Type: application/json" 
-d "\{ \"clientId\": \"dt0s04.AAAAAAAA\", \"clientSecret\": \"dt0s04.AAAAAAAA.AAAA00AAAAAAAAAA0OBA6AVNCQVQAGSO25VM5KDFBIKEZ7HVG6THKTHGWAY5ACCL\", \"scope\": \"sso20-managed-cluster-offline-bundle\"}"

Request URL

https://mcsvc.dynatrace.com/rest/public/v1.0/oauth/api-token

Response body

{
  "token": "aaA0aAAaAaAAA0AaAAAaaAaaAaAAAaA0AaA0.eyJzdWIiOiJjbHVzdGVyLTBhMDBhMGEwLTkyZWMtMTFlNy1iMWU2LTEyZmJkMWZiMzczMkBkeW5hdHJhY2UtbWFuYWdlZC5jb20iLCJhdWQiOiJkdDBzMDQuTFFWT1FQQVMiLCJ1aWQiOiI5N2Y0OGFhMy1jYmRiLTRkMzEtOGE2YS02NjUyNTQxMzY5MTIiLCJzY29wZSI6InNzbzIwLW1hbmFnZWQtY2x1c3Rlci1vZmZsaW5lLWJ1bmRsZSIsImlzcyI6Imh0dHBzOi8vc3NvLXNwcmludC5keW5hdHJhY2VsYWJzLmNvbTo0NDMiLCJleHAiOjE2MTU0NzcxNTIsImdyYW50VHlwZSI6ImNsaWVudF9jcmVkZW50aWFscyIsImlhdCI6MTYxNTQ2OTk1Mn0.svn34bJEZbziHVyV7cKW9OWwvBwakzH0Ke_Iu19GV743zrC4zHuX4YQFts-JkEHRYmnVvnQRwPPCakuq0LHVjA",
  "scopes": [
    "sso20-managed-cluster-offline-bundle"
  ],
  "expiresAt": 1615477153001
}

Response code

200