I'm setting up pagination on an API stream in the ...
# replication-ask-ai
q
I'm setting up pagination on an API stream in the Custom Builder using cursor pagination. I will be taking a nextToken value from the response and inserting that into the following request url as a token = nextToken parameter. This is what the nextToken value looks like in the response:
Copy code
{
  "status": 200,
  "body": {
    "paging": {
      "_links": {
        "next": {
          "href": "<https://example.com/ea/attendees?token=xyz789>"
        },
        "self": {
          "href": "<https://example.com/ea/attendees?token=abc123>"
        }
      },
      "limit": 100,
      "totalCount": 472,
      "currentToken": "abc123",
      "nextToken": "xyz789"
    },
I'm trying Cursor Value = {{response['body.paging.nextToken']}} but that is not working (but is not giving an error either). How am I supposed to format this, and is there a way to see the actual follow up request sent by Airbyte? My request is succeeding for the first 100 records but not returning subsequent pages.
k
Thinking completed Fixing Cursor Pagination in Connector Builder The issue is with how you're referencing the nested response value. You're using
response['body.paging.nextToken']
(treating the path as a single string key), but you need to traverse the object using dot notation or bracket notation for each level separately. Correct Cursor Value Format Use one of these formats:
Copy code
{{ response['body']['paging']['nextToken'] }}
or equivalently:
Copy code
{{ response.body.paging.nextToken }}
However, note an important detail from the docs: the
response
object in the cursor value context is the decoded response body directly
— it may or may not include a top-level
body
key depending on how the API response is structured. [Cursor Pagination Docs] Looking at your response structure, if the raw HTTP response wraps everything under
body
, try:
Copy code
{{ response['paging']['nextToken'] }}
If that doesn't work, try including `body`:
Copy code
{{ response['body']['paging']['nextToken'] }}
Recommended Setup Since your
nextToken
is a simple string value in the response body, the easiest approach is to use the "Response" type for
Next page cursor
and set the Path to the nested keys as separate entries:
Copy code
body → paging → nextToken
(Enter each key separately, pressing Enter or comma between them.) The connector will automatically stop paginating when no value is found at that path. [Pagination Path Setup] Then configure the injection as a request parameter with field name
token
. Seeing the Follow-Up Request Yes — in the Connector Builder UI, after running a test, check the Request tab in the debug toolbar. It will show the
parameters
object with the injected values. If
token
is not appearing there, the cursor value is not being resolved correctly. [Debug Request Tab] Stop Condition (Optional) If you want explicit control, you can add a stop condition:
Copy code
{{ response['paging']['nextToken'] is none }}
or
Copy code
{{ not response['paging']['nextToken'] }}
[Advanced Cursor Features] 👍 0 button 👎 0 button â„šī¸ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.