cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PRO TIP - Dynatrace Account Management API Postman Collection

DanielS
DynaMight Guru
DynaMight Guru
My fellow DynaMight :dynamight: Patrick Hofmann pahofmann has shared several Postman collections for the different Dynatrace API's with the community.
Encouraged by this because I use them daily, I created a Postman Collection for the new Account management API following the guidelines used in the ones created by Patrick.
I share the steps to get this working in your Postman client.
 

1. Create an Oauth2 Client in Dynatrace

For more reference in this step you can take a look at this post from @AgataWlodarczyk with a video from @adam_gardner 

  1. Open the User menu and select Account settings (in latest Dynatrace, Account Management).

  2. On the top navigation bar, go to Identity & access management > OAuth clients.

  3. Select Create client.

  4. Provide an email of the user who owns the client.

  5. Provide a description for the new client.

  6. Select the required token scopes. These are the scopes that the client will be able to grant. Tokens generated by the client might have different scope sets.

    • Allow read access for identity resources (users and groups) account-idm-read
    • Allow write access for identity resources (users and groups) account-idm-write
    • Allow read access for environment resources account-env-read
    • Allow write access for environment resources account-env-write
    • Allow read access for usage and consumption resources account-uac-read
    • Allow write access for usage and consumption resources account-uac-write
    • Allow IAM policy configuration for environments. iam-policies-management; iam:policies:read; iam:policies:write; iam:bindings:read; iam:bindings:write; iam:effective-permissions:read.
  7. Select Create client.

  8. Copy the generated information to the clipboard. Store it in a password manager for future use.

 

2. Create an Environment for your Collection in Postman

 

EnvironmentEnvironment

  1. Select Environments.
  2. Click the + sign.
  3. Name your Environment.
  4. The environment needs that you define these variables:
    • DT_CLIENT_ID Provided when you create the Oauth2 client in step 1.
    • DT_CLIENT_SECRET Provided when you create the Oauth2 client in step 1.
    • DT_ACCOUNT_URN Provided when you create the Oauth2 client in step 1.
    • DT_UUID Same value of DT_ACCOUNT_URN but stripping the urn:account:
    • DT_SCOPE A list of required scopes separated by a whitespace.
    • DT_TOKEN_URL ⚠️ PLEASE DON'T CHANGE THIS VALUE ⚠️ The URL https://sso.dynatrace.com/sso/oauth2/token where you need to obtain your Bearer token after create the Oauth2 client.
    • DT_TOKEN_NAME The name for your token.
    • DT_TOKEN In this variable you will store your assigned dynamic token.
    • DT_HOST ⚠️ PLEASE DON'T CHANGE THIS VALUE ⚠️ The URL api.dynatrace.com of the Dynatrace API for Account Management.
  5. Leave this Environment Selected.

 

3. Import Dynatrace Account Management API Collection

 

ImportImport

  1. Download the Dynatrace Account Management JSON from the repository.
  2. Select Collections.
  3. Click on Import and choose the previously downloaded JSON.
  4. Your Dynatrace Account Management API v1 Collection has been added to your collection.

 

4. Get your Bearer Token

 

Get your Bearer TokenGet your Bearer Token

  1. ⚠️ DON'T FORGET TO HAVE SELECTED THE ENVIRONMENT CREATED IN STEP 2 ⚠️
  2. Select your recently imported Dynatrace Account Management API v1 Collection.
  3. Click on the Authorization tab.
  4. Click on Get New Access Token.
  5. Wait until the token has been collected.
  6. Click on Use Token.
  7. ⚠️ BE SURE TO SELECT ALL YOUR TOKEN ⚠️ And then select Set as variable.
  8. Choose the DT_TOKEN variable to store your new Bearer Token.

 

5. Ready, Set, Go 🚦

 

Using CollectionUsing Collection

  1. ⚠️ DON'T FORGET TO HAVE SELECTED THE ENVIRONMENT CREATED IN STEP 2 ⚠️
  2. Select Collections.
  3. Then Select the Request you want to use and check the parameters.
  4. Click on Send.
  5. And if everything goes well you get your Response.
The true delight is in the finding out rather than in the knowing.
13 REPLIES 13

ChadTurner
DynaMight Legend
DynaMight Legend

Thank you for documenting this @DanielS 

-Chad

Your welcome @ChadTurner. The use of Oauth2 clients to obtain valid Bearer tokens is what is coming to Dynatrace API.

The true delight is in the finding out rather than in the knowing.

dannemca
DynaMight Guru
DynaMight Guru

This is gold!

Site Reliability Engineer @ Kyndryl

Thanks @dannemca It took me a while to implement it in Postman, but it will surely be very useful for interacting with the API. I'm thinking improvements for future releases.

The true delight is in the finding out rather than in the knowing.

Mizső
DynaMight Guru
DynaMight Guru

WOW!

This is a very good and detailed guide! Thanks for sharing it @DanielS !

Dynatrace Community RockStar 2024, Certified Dynatrace Professional

Thanks @Mizső hope it helps.

The true delight is in the finding out rather than in the knowing.

Kenny_Gillette
DynaMight Leader
DynaMight Leader

GOLDEN!!!

Dynatrace Certified Professional

Thanks @Kenny_Gillette 

The true delight is in the finding out rather than in the knowing.

Malaik
Champion

Awesome, Thanks to share.

Sharing Knowledge

PedroDeodato
DynaMight Pro
DynaMight Pro

As a Partner who often needs to manage several Accounts, this is so very very useful!! Thank you, @DanielS !!

Best regards, Pedro Deodato

Glad to help @PedroDeodato 

The true delight is in the finding out rather than in the knowing.

tijust1
Advisor

Thanks @DanielS for providing this valuable information. It helps me a lot while handling multiple environments. 

Tijust

Dynatrace Professional Certified

Leonardo_Val
Participant

Great contribution! Thank you so much!

Observability Manager - SDNET - Dynatrace Professional Certified

Featured Posts