Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Iterative Rest API call to Different APIs

prashantv45
New Contributor
New Contributor

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 you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

prashantv45
New Contributor
New Contributor

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 you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.