Announcing the SAVIYNT KNOWLEDGE EXCHANGE unifying the Saviynt forums, documentation, training, and more in a single search tool across platforms. Click HERE to read the Announcement.

How to configure REST Connector with Looping logic to perfrom User Import

prajakta
New Contributor III
New Contributor III

Hi,

Customer application supports REST API’s for extracting the user information. 
The user data can be retrieved by invoking below POST API's -
  1. A request is sent to the Request URL - upon successful authentication 200 response will be returned along with Correlation ID
  2. Using the Correlation ID, a request is sent to the Request Status URL. Upon successful request completion, this request status call will return the XML Payload in an extractable format within the response. 

Thus, here the 2nd API need to be invoked in loop to check status. Can we perform user import by invoking multi requests with a looping logic as mentioned above i.e the 2nd API need to be invoked till it returns status as completed.

 

Thanks

Prajakta

8 REPLIES 8

ManishAcharya
Saviynt Employee
Saviynt Employee

Please check the REST Connector guide and look for Support for Multiple API calls

It uses ${userIdentifier} to loop through users to get more data. 

Thank you for replying.

Issue is not invoking 2nd API call to get user's more data. Application provides data by below API calls:

1. API call 1 to Submit request. A request is submitted at application to retrieve user data.

2. API call 2 : check if the submitted request from call 1 is completed or not. If the request is completed user data will be returned in response else it will return Request status is pending. 

Now, the 2nd call needs to be invoked by providing request ID till it returns the data. 

 Appreciate if you could provide some insights to achieve the integration

 


Reference : https://saviynt.freshdesk.com/support/solutions/articles/43000521736-rest-connector-guide%C2%A0 

 

Generic feature in provisioning JSON

  1. Binding response values from one call to another - 
    The REST connector uses response values of one call as input parameter into another call for multiplecalls. In the following example, the first API call gets descriptor ID for the requested account and the value of the descriptor ID is used as input in the next API call.

    {
      "accountIdPath": "call1.message.id",
      "dateFormat": "yyyy-MM-dd'T'HH:mm:ssXXX",
      "call": [
        {
          "name": "call1",
          "connection": "userAuth",
          "url": "https:/<domain name>/2.0/users",
          "httpMethod": "POST",
          "httpParams": "{\"login\":\"${user.username}\",\"name\": \"${user.firstname}\"}",
          "httpHeaders": {
            "Authorization": "${access_token}"
          },
          "httpContentType": "application/json",
          "successResponses": {
            "statusCode": [
              201
            ]
          }
        },
        {
          "name": "call2",
          "connection": "userAuth",
          "url": "https:/<domain name>/2.0/folders",
          "httpMethod": "POST",
          "httpParams": "{\"name\":\"${response.call1.message.name}_${response.call1.message.id}\",\"parent\":{\"id\":\"0\"}}",
          "httpHeaders": {
            "Authorization": "${access_token}"
          },
          "httpContentType": "application/json",
          "successResponses": {
            "statusCode": [
              201
            ]
          }
        }
      ]
    }


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

prajakta
New Contributor III
New Contributor III

Appreciate your response and reference json showcasing binding parameters among API calls.

However, will it loop the 2nd call till request submitted in 1st call is completed? The submitted request at the application side might take few seconds to 30mins to process and send data in response. Thus not sure how long the 2nd API call invocation is required. How to keep on looping or adding wait in REST connector configuration??

If Api takes 30 min to process add timeout configuration in custom_json


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

The API response will be immediate if request at the application side not completed then response will be Pending Request and if application side request completed then response will have user data.

Having said this :

1. How to invoke 2nd API till request is completed

2. Or how to add a delay for invoking 2nd API.

I think Timeout configuration wont help in any such scenario

 

Yes you can loop on response

rushikeshvartak_0-1666271219149.png

 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Appreciate your response. The callCondition and callListPath is available for Provisioning operation and not in ImportUserJSON