WS Pagination with header - Error ConnectorException

:bangbang: Please be sure you’ve read the docs and API specs before asking for help. Also, please be sure you’ve searched the forum for your answer before you create a new topic.

Hi everyone, how are you?

If anyone has any suggestions, I have an application that uses pagination via a cursor-based header.

For example, this link is: https://api.example.com/users?cursor=abc123; rel=“next”

GreenHouse Application

I managed to get through all the pages using the suggestion from the documentation:

Paging Based on Response Header Links

I’ve already tried some tests with (which worked, but the error persists at the end):

TERMINATE_IF $responseHeaders.link.next$ == “”
$endpoint.fullUrl$ = $responseHeaders.link.next$

TERMINATE_IF $responseHeaders.link.next$ == NULL
$endpoint.fullUrl$ = $responseHeaders.link.next$

But I’m encountering the error:

sailpoint.connector.ConnectorException: Url: , Message: 0 : org.apache.http.client.ClientProtocolException, HTTP Error Code: 0

{
"httpMethodType": "GET",
"pagingInitialOffset": 0,
"sequenceNumberForEndpoint": "2",
"uniqueNameForEndPoint": "Account Aggregation",
"rootPath": "$[*]",
"body": {
"jsonBody": null,
"bodyFormat": "raw"
},
"paginationSteps": "TERMINATE_IF $responseHeaders.link.next$ == \"\"\n$endpoint.fullUrl$ = $responseHeaders.link.next$",
"responseCode": [
"2**"
],
"resMappingObj": {
"updated_at": "$.updated_at",
"employee_id": "$.employee_id",
"agency_id": "$.agency_id",
"name": "$.name",
"created_at": "$.created_at",
"last_name": "$.last_name",
"primary_email": "$.primary_email",
"id": "$.id",
"first_name": "$.first_name",
"job_title": "$.job_title",
"deactivated": "$.deactivated"
},
"contextUrl": "/v3/users?per_page=500",
"pagingSize": 500,
"curlEnabled": false,
"header": {
"Authorization": "Bearer $application.accesstoken$",
"Accept": "application/json"
},
"operationType": "Account Aggregation",
"xpathNamespaces": null,
"parentEndpointName": null
},

If anyone has another Suggestion, and if you can help me.

Thanks

can you check what is this returning: $responseHeaders.link.next$

1 Like

Are you sure all pages have been aggregated? Can you make an API call in Postman and share the response header received?

Hello Nithesh,

Yes, I do, judging by the number of accounts that appear on the portal (over 6,000 in total).

I did a new test, using the parameter that our colleague used in another forum:

TERMINATE_IF $RECORDS_COUNT$ < 5000

And it seems to have worked here too!

Thank you everyone for your support.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.