Pagination for Adyen web-connector stopping at 100-110 accounts

I’ve tried the following paginations but both attempts would stop at 110 or 100 users.

Stopping at 100 accounts

TERMINATE_IF $response.links.next.data.cursor$ == NULL
$cursor$ = $response.links.next.data.cursor$
$endpoint.fullUrl$ = $application.baseUrl$ + “"/companies/XXXXXXX/users?cursor=” + $cursor$

Stopping at 110 accounts

$sysparm_limit$ = 100
TERMINATE_IF $RECORDS_COUNT$ < $sysparm_limit$
$sysparm_offset$ = $sysparm_offset$ + $sysparm_limit$
$endpoint.fullUrl$ = $application.baseUrl$ + "/companies/xxxxxxxxx/users?sysparm_fields=sys_id&sysparm_limit=100&sysparm_offset=" + $sysparm_offset$

@DedrickTai , Can you share more details on how the JSON response looks like from postman for this API? It’d be great if you can provide that JSON response here so that we can figure out the issue with this logic.

Thanks,
Arshad.

hi @DedrickTai can you try below

For Cursor-Based Pagination

IF $response.links.next.data.cursor$ != NULL
  $cursor$ = $response.links.next.data.cursor$
  $endpoint.fullUrl$ = $application.baseUrl$ + "/companies/XXXXXXX/users?cursor=" + $cursor$
ELSE
  TERMINATE

Or, if links.next.href is available:


IF $response.links.next.href$ != NULL
  $endpoint.fullUrl$ = $response.links.next.href$
ELSE
  TERMINATE

For Offset-Based Pagination


$sysparm_limit$ = 100
IF $RECORDS_COUNT$ < $sysparm_limit$
  TERMINATE
ELSE
  $sysparm_offset$ = $sysparm_offset$ + $sysparm_limit$
  $endpoint.fullUrl$ = $application.baseUrl$ + "/companies/xxxxxxxxx/users?sysparm_limit=" + $sysparm_limit$ + "&sysparm_offset=" + $sysparm_offset$

Hi @DedrickTai You need to setup offset and limit in such a way in the URL sot hat it can paginate through next set of records till all the records are fetched , you need to put that logic in the above code.

$endpoint.fullUrl$ = $application.baseUrl$ + “/companies/xxxxxxxxx/users?sysparm_fields=sys_id&sysparm_limit=100&sysparm_offset=” + $sysparm_offset$

based on the documentation It does support href. would I need to modify my context url? I tried

IF $response.links.next.href$ != NULL
  $endpoint.fullUrl$ = $response.links.next.href$
ELSE
  TERMINATE

But in progress status just spins without giving any accounts