<@U04S8PLJWMT> using cursor pagination, the cursor...
# ask-ai
s
@kapa.ai using cursor pagination, the cursor value being injected into the path does not match what is in the response
k
Based on the information provided in the knowledge sources, it appears that you're encountering an issue with cursor pagination in Airbyte where the cursor value being injected into the path doesn't match what's in the response. This could be related to how the cursor value is being extracted and used. Let's address this issue: 1. First, ensure that your cursor value extraction is correct. According to the [Cursor Pagination documentation](https://docs.airbyte.com/connector-development/connector-builder-ui/pagination#cursor-pagination), the cursor value should be extracted from the response using a proper path. For example:
Copy code
yaml    cursor_value: '{{ response.get("meta", {}).get("next_token", {}) }}'
2. If the extraction is correct, but the value is not being properly injected into the path, you might need to use custom parameter injection. As mentioned in the [Custom parameter injection documentation](https://docs.airbyte.com/connector-development/connector-builder-ui/pagination#custom-parameter-injection), you can disable the default injection in the pagination form and use the generic parameter section to configure the injection manually. 3. In your case, you might need to use the
next_page_token
variable to configure the correct path. For example:
Copy code
yaml    {{ next_page_token['next_page_token'] or '0' }}
4. If the issue persists, it could be related to how the
CursorPagination
strategy is implemented in your connector. You might want to review the [CursorPagination reference](https://docs.airbyte.com/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/CursorPagination) to ensure all required properties are correctly set. 5. If you're still facing issues, it might be helpful to enable debug logging to see exactly what values are being extracted and injected at each step of the pagination process. If none of these suggestions solve your problem, you might be encountering a bug in Airbyte. In that case, consider opening an issue on the [Airbyte GitHub repository](https://github.com/airbytehq/airbyte) with detailed information about your connector configuration and the specific behavior you're observing.
s
@kapa.ai currently this is set up as follows:
Copy code
type: DefaultPaginator
page_token_option:
  type: RequestPath
pagination_strategy:
  type: CursorPagination
  page_size: 50
  cursor_value: '{{ response.get("pagination", {}).get("next_url", {}) }}'
  stop_condition: '{{ not response.get("pagination", {}).get("next_url", {}) }}'
the response body for the pagination object is:
Copy code
<https://ads-api.reddit.com/api/v3/ad_accounts/[redacted]/reports?page.token=[redacted]>
the subsequent request for the next page is:
Copy code
<https://ads-api.reddit.com/ad_accounts/[redcated]/reports?page.token=[redacted]>
so it excluding
/api/v3/
from the next page request.
k
A message from kapa.ai
New message text here