Showing results for 
Search instead for 
Did you mean: 

Multiple organizations listing Admins

Here to help

Multiple organizations listing Admins

Hey all, i'm pretty new to Java and all these API calls, but I'm attempting to use Postman to pull my list of about 40 orgs and show me the admins across them...


I've attempted to run a for loop in the GET ListOrgs which then calls the next GET (GetAdmins) but it's not working and i'm only seeing the last item in the json.


I need to run the GetAdmins against all orgs returned in the GetOrgs... can anyone help?


My code:


tests["Status code is 200 (that's good!)"] = (responseCode.code === 200);

if (responseCode.code === 200) {
    var jsonData = pm.response.json();
    var json = [];
    postman.setEnvironmentVariable("json", jsonData)
  for (var key in jsonData ) {
        if (jsonData.hasOwnProperty(key)) {
            postman.setEnvironmentVariable("organizationId", jsonData[key].id)
            postman.setEnvironmentVariable("orgname", jsonData[key].name)
            tests[jsonData[key].name + " " + jsonData[key].id] = !!jsonData[key].name;

else {

Thanks in advance!