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

Using Dynatrace API

thierry_chea1
Participant

Hello,

According to the documentation, I was trying to make a simple call to the Dynatrace API, but i got the following error :

{"error":{"code":404,"message":"failed to resolve tenant <epw504>"}}

Here was the curl I have made :

curl -L -H "Authorization: Api-Token tokenID" "https://myDomain.com/api/v1/problem/status"

Of course, I have previously generated a token id from the Dynatrace Managed web interface.

Is there a step I have missed ?

Regards,

6 REPLIES 6

hayden_miedema
Inactive

Hi Thierry,

This seems like an issue with the domain based on the error message. You have above that you are using "https://myDomain.com/api/v1/problem/status". This should follow the format: https://{id}.live.dynatrace.com

So your URL for the call should be https://epw504.live.dynatrace.com/api/v1/problem/status. Can you verify that it is following this standard?

Thanks,

Hayden

wolfgang_beer
Dynatrace Champion
Dynatrace Champion

Is it a Dynatrace SaaS or Managed installation? For your own Managed installation you have to use a different URL scheme as it is described within that help page:

https://www.dynatrace.com/support/help/dynatrace-a...

Dynatrace Managed URL Prefix

https://owndomain/e/{id}/api/v1/

thierry_chea1
Participant

Hello,

Sorry, I didn't mentionned what type of Dynatrace I used, it is a Managed installation.

Where can I find the id ? Is it from the Interface at Home --> Settings --> Public Endpoints ?

Regards,

wolfgang_beer
Dynatrace Champion
Dynatrace Champion

The environment id is the unique id part within the Webbrowser URL when you login into one of your environments. You find the id after the /e/ part within your web browser.

See help page here:

https://www.dynatrace.com/support/help/get-started/introduction/why-do-i-need-an-access-token-and-an-environment-id/

steve_caron
Dynatrace Advisor
Dynatrace Advisor

Thierry, if you click on Environments, in the menu on the left, you will have your Environments listed. Click on the environment where your problem was reported (the one you want to export details using the API). Click on Go to Environment button. Once you are in your environment home dashboard, look at the URL box of your browser and you will have the formate described by Wolfgang, including the environment ID, ie https://owndomain/e/{environmentID}/

Thanks, I have followed your steps and have found the environmentID