We are delighted to share our new EIC Delivery Methodology for efficiently managing Saviynt Implementations and delivering quick time to value. CLICK HERE.

Freshservice Pagination - REST Connector - Headers_Link

SowmithriV
Regular Contributor
Regular Contributor

Hi Everyone, 

 

Trying to integrate the Freshservice with Saviynt. During the Import, getting stuck at the Pagination.

The Freshservice API's Pagination link is available in the Headers - Link. Refer the screenshot below,

SowmithriV_0-1685689951675.png

We will have to replace the < and >; rel="next" from the Headers_Link and then pass this a the nextUrlPath. Also when there is no Link key present in the Headers, it means that's the end of it. 

<https://ringcentral-fs-sandbox.freshservice.com/api/v2/requesters?include_agents=true&per_page=100&p...>; rel="next"

I've trailed following Paginations but both doesn't work. Please suggest how I can make this work. Attaching the complete ImportAcctEnt JSON for reference

Trail 1
{
"pagination": {
"nextUrl": {
"nextUrlPath": "${headers?.Link?.size()>0?headers.Link.replace('<', '').replace('>; rel="next"',''): null}"
}
}

Trail2
{
"pagination": {
"nextUrl": {
"nextUrlPath": "${headers?.Link?.size()>0?headers.Link.replace('<', '').replace('>;20rel=%22next%22',''):null}"
}
}
}

}

 

11 REPLIES 11

SB
Saviynt Employee
Saviynt Employee

Can you escape double quotes in your replace function and then try replace('>; rel=\"next\"','')


Regards,
Sahil

SowmithriV
Regular Contributor
Regular Contributor

Thank you Sahil. That did work for me. I'm now seeing a different issue while running the Access Import. Attaching the same for your reference and my ImportAcctEnt JSON is available in my post. Can you please let me know how I can fix this?

SowmithriV_0-1686042150004.png

 





SB
Saviynt Employee
Saviynt Employee

This appears to be an issue with your Connection JSON. Can you check if the call name in Connection JSON is same as that you have defined in Import JSON

"connection": "acctAuth",


Regards,
Sahil

SowmithriV
Regular Contributor
Regular Contributor

yes it is the same in my connectionJSON. Can you please refer the below,

{
"authentications": {
"acctAuth": {
"authType": "Basic",
"url": "https://xxx-fs-sandbox.freshservice.com/api/v2/requesters",
"httpMethod": "POST",
"httpParams": {
},
"httpHeaders": {
"contentType": "application/json"
},
"httpContentType": "application/json",
"properties": {
"userName": "xxx",
"password": "xxxxx"
},
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed"
],
"timeOutError": "Read timed out",
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Basic",
"accessToken": "xxx",
"testConnectionParams": {
"http": {
"url": "https://xxx-fs-sandbox.freshservice.com/api/v2/requesters",
"httpMethod": "GET",
"requestBody": "",
"httpParams": {
},
"httpHeaders": {
"contentType": "application/json",
"Authorization": "xxx"
},
"httpContentType": "application/json"
},
"successResponse": [
],
"successResponsePath": "responseText",
"errors": [
"fail",
"error"
],
"errorPath": "responseText"
},
"apiRateLimitConfig": {
"retryAfterCalls": 100,
"retryWaitSeconds": 60
}
}
}
}

SB
Saviynt Employee
Saviynt Employee

In that case can you check for the logs. Do ensure to update ConfigJSON param in the REST connection with value {"showLogs":true} before running the job. This enables additional logging for REST connection and may be helpful.


Regards,
Sahil

SowmithriV
Regular Contributor
Regular Contributor

Hi @SB I will try this for the access import. There is one more issue with the account import. When I first ran the account import, the accounts were reconciled and everything looks good. The second time I run it, I got error that it's "Account threshold (accountThresholdValue) exceeded. Current threshold limit 300 and missing accounts during import 774. No action was taken on missing accounts due to the threshold breach." That is, whatever accounts got reconciled, will show as manually suspended from import if I increase the threshold. How can I fix this? Can you please help check the JSON once? Attaching the Freshservice ImportAcctEntJSON for reference.

hi @SB, Can you please check this at your end and share your suggestions?

If your goal is to mark the missing accounts as SFIS, then increase the accountThreshold to 1000 in your import JSON. 

"accountThresholdValue": 1000,

 

Regards,
Naveen Sakleshpur
If this reply answered your question, please click the Accept As Solution button to help future users who may have a similar problem.

SowmithriV
Regular Contributor
Regular Contributor

Hi @naveenss , thanks for the response. When I do that, all the accounts move to suspended from the import, which is not what I want.
@SB , When I do the import from application for the first time, I'm seeing all the accounts and groups in the Saviynt system. The second time I run the import it is failing with Account Threshold error that all the accounts that were reconciled are now missing, whereas these accounts are present in the endpoint. 

SB
Saviynt Employee
Saviynt Employee

This does mean that the accounts data is not received as part of the api call. You will need to  update ConfigJSON param in the REST connection with value {"showLogs":true} before running the job. 

The jobs should print where it did receive any data or if the call failed or any other reason to help identify with the issue.


Regards,
Sahil

SB
Saviynt Employee
Saviynt Employee

I am not sure I understood the ask. Can you rephrase it.


Regards,
Sahil