Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Iterative Rest API call to Different APIs

prashantv45
New Contributor II
New Contributor II

Hello Team,

Good Day!

There is a requirement to integrate to a rest API, where we are getting list of company IDs in the get token API response in below format.

"access_token": "token",
    "expires_in": 1234,
    "token_type": "Bearer",
    "scope": "api.read_only",
    "group_companies": [
        {
            "group_id": 123456,
            "group_description": "RL Daly",
            "companies": [
                {
                    "company_id": 123456,
                    "company_name": "Name of Company1",
                    "company_code": "AB1"
                },
               {
                    "company_id": 12345678,
                    "company_name": "Name of Company2",
                    "company_code": "AB2"
                },
]
}


Now using the company id from token response api we have to create the import user URL and fetch user from that URL. Example https://client_App_URL/odata/v1.1/<company_id>/Employee
We have around 24 companies ID present in the token response, and we have to fetch users from 4 companies (We have to call 3 apis to get complete records of a user which means in total its 3*4 = 12 calls).
Is there a better way to perform the task than hard coding each companies ID in the URL and perform the API call.
3 REPLIES 3

rushikeshvartak
All-Star
All-Star

You need to hardcode company id as current product design support single api response rather than iteration 


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

prashantv45
New Contributor II
New Contributor II

Thanks @rushikeshvartak for your response.

Raise idea ticket 

https://forums.saviynt.com/t5/identity-governance/importaccountentjson-iterating-through-multiple-en...

:light_bulb: For any desired improvements or enhancements to this process, Saviynt encourages you to submit your proposal through Saviynt's Ideas Portal at https://ideas.saviynt.com/ideas/

Your valuable input is crucial to shaping the evolution of Saviynt systems.

Please notify us once the idea ticket has been created.:light_bulb:


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.