To get authenticated to use the Mission Control API, you need a valid OAuth REST API client
token. Access to the API is controlled by scope, meaning that you also need the proper permissions assigned to the token. See the description below to find out which permissions are required to use it.
Register a client (Generate SSO client credentials).
Execute the following REST call:
curl -X POST "https://mcsvc.dynatrace.com/rest/public/v1.0/oauth/registration/withLicenseKey"-H "accept: application/json"-u "<cluster-identifier>:<license-key>"
where:
<cluster-identifier>
is a cluster identifier (in Dynatrace, go to Licensing). For example, 0a00a0a0-92ec-11e7-b1e6-12fbd1fb3732
<license-key>
is a license key provided to you in welcome email and visible in Licensing. For example, 0a0aAAAA0jeUv6N
.As a result, you should receive a JSON response containing clientId
and clientSecret
and the response code 200
. For example:
{"clientId": "dt0s04.AAAAAAAA","clientSecret": "dt0s04.AAAAAAAA.AAAA00AAAAAAAAAA0OBA6AVNCQVQAGSO25VM5KDFBIKEZ7HVG6THKTHGWAY5ACCL","scopes": ["sso20-managed-cluster-offline-bundle","sso20-identity-linking"]}
200
Generate a token (Generate SSO token).
Currently, only the sso20-managed-cluster-offline-bundle
scope, which allows to generate update package download URLs is supported.
Using the clientId
and clientSecret
from the previous call, execute the following REST call:
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\"}"
As a result you will receive a JSON response with a token, associated scopes and the token expiration date. For example:
{"token": "aaA0aAAaAaAAA0AaAAAaaAaaAaAAAaA0AaA0.eyJzdWIiOiJjbHVzdGVyLTBhMDBhMGEwLTkyZWMtMTFlNy1iMWU2LTEyZmJkMWZiMzczMkBkeW5hdHJhY2UtbWFuYWdlZC5jb20iLCJhdWQiOiJkdDBzMDQuTFFWT1FQQVMiLCJ1aWQiOiI5N2Y0OGFhMy1jYmRiLTRkMzEtOGE2YS02NjUyNTQxMzY5MTIiLCJzY29wZSI6InNzbzIwLW1hbmFnZWQtY2x1c3Rlci1vZmZsaW5lLWJ1bmRsZSIsImlzcyI6Imh0dHBzOi8vc3NvLXNwcmludC5keW5hdHJhY2VsYWJzLmNvbTo0NDMiLCJleHAiOjE2MTU0NzcxNTIsImdyYW50VHlwZSI6ImNsaWVudF9jcmVkZW50aWFscyIsImlhdCI6MTYxNTQ2OTk1Mn0.svn34bJEZbziHVyV7cKW9OWwvBwakzH0Ke_Iu19GV743zrC4zHuX4YQFts-JkEHRYmnVvnQRwPPCakuq0LHVjA","scopes": ["sso20-managed-cluster-offline-bundle"],"expiresAt": 1615477153001}
200
Authenticate in your API calls.
Your API call can get authenticated per call via an HTTP header authorization. You can authenticate by attaching the token to the authorization HTTP header preceding the Bearer
realm.
curl -X GET "https://mcsvc.dynatrace.com/rest/public/downloads/offline-bundle/published"-H "accept: application/json"-H "Authorization: Bearer aaA0aAAaAaAAA0AaAAAaaAaaAaAAAaA0AaA0.eyJzdWIiOiJjbHVzdGVyLTBhMDBhMGEwLTkyZWMtMTFlNy1iMWU2LTEyZmJkMWZiMzczMkBkeW5hdHJhY2UtbWFuYWdlZC5jb20iLCJhdWQiOiJkdDBzMDQuTFFWT1FQQVMiLCJ1aWQiOiI5N2Y0OGFhMy1jYmRiLTRkMzEtOGE2YS02NjUyNTQxMzY5MTIiLCJzY29wZSI6InNzbzIwLW1hbmFnZWQtY2x1c3Rlci1vZmZsaW5lLWJ1bmRsZSIsImlzcyI6Imh0dHBzOi8vc3NvLXNwcmludC5keW5hdHJhY2VsYWJzLmNvbTo0NDMiLCJleHAiOjE2MTU0NzcxNTIsImdyYW50VHlwZSI6ImNsaWVudF9jcmVkZW50aWFscyIsImlhdCI6MTYxNTQ2OTk1Mn0.svn34bJEZbziHVyV7cKW9OWwvBwakzH0Ke_Iu19GV743zrC4zHuX4YQFts-JkEHRYmnVvnQRwPPCakuq0LHVjA"
Unless otherwise specified, the following response codes are used:
200
- OK. The request is successful.400
- Bad request. The request has failed. The body of the response provides additional details.401
- Unauthorized. The token authentication has failed. Check to see if your token has the required permissions.404
- Not found. The requested resource is not found. Check if your input is correct.429
- Too many requests. Mission Control is currently busy, try again later.