08 Oct 2019 02:34 PM - last edited on 15 Dec 2021 02:04 PM by MaciejNeumann
I am attempting to use Postman to extract second level data from the Dynatrace API. For example, I can extract both top level (adding no id) and second level (using id). What I would like to do is dynamically query any first level API (e.g. host) then using that dataset, loop thru the first level data to call the same API using the ID from the top level call, resulting in getting all data for that particular API.
Solved! Go to Solution.
08 Oct 2019 04:42 PM
Your approach sounds reasonable. Do you have a specific question?
17 Oct 2019 03:09 PM
How do I get Postman to make multiple calls to the API passing the ids (one at a time i would assume) from the first request to a second request? Is there a limitation in Postman that will not allow this?
17 Oct 2019 04:59 PM
It’s rather question to postman community 🙂 in general such things may be easier to do in jMeter for example
17 Oct 2019 05:01 PM
Yes, I'm asking there and I did see another reference that mentioned JMeter. Thanks
18 Oct 2019 05:14 PM
Hopefully a quick question: where do I put the api-token in jMeter?
18 Oct 2019 05:56 PM
Dynatrace accepts the token as a query parameter or an HTTP Header. HEre's the doc page that describes this from the Dynatrace perspective.
I assume you know how to define either of these in JMeter. If not, I recommend JMeter documentation.
18 Oct 2019 06:46 PM
Opps, what I mean is, in jMeter, what 'add-on' would I use for api-token. It doesn't seem to like it in the parameters of the HTTP request. In Postman, is was pretty straight forward.
18 Oct 2019 08:06 PM
You should read jMeter documentation related to authentication. You can pass api-token as query parameter in url, or as a header. You have jMeter documentation available online for both of them. I suggest watching some YouTube videos related to how to use jMeter. In general when you want to extract some data using jMeter automatically I suggest starting some basics about assertions.
Sebastian
18 Oct 2019 10:10 PM
i am not a postman expert here but as far as I have played with postman is not something it supports out of the box. you have to write a script to achieve this.
https://learning.getpostman.com/docs/postman/scripts/intro_to_scripts/
Where it would extract the first level of (iD) and save them to a variable which you can use to iterate over and extract the second level.
I usually use node JS to build more complex scripts, for example have one where I enter Env Ids and tokens for source and destination and I move management zones between environments and servers.. there is more logic in between where I manipulate the objects etc, etc..but you get the idea.
Regards,
Erick