I want to insert the next page cursor into the out...
# replication-ask-ai
f
I want to insert the next page cursor into the outgoing http request. I managed to extract the cursor value trough the path I want to insert it inside the variables['after'] object that is sent in the json payload, what should be the "inject into" and "key name" ?
k
To insert the next page cursor into the outgoing HTTP request, you can use the
CursorPagination
strategy. This strategy evaluates an interpolated string to define the next page to fetch. In your case, you have already managed to extract the cursor value through the path. Now, you want to insert it into the
variables['after']
object that is sent in the JSON payload. To achieve this, you can use the
inject_into
and
key_name
fields. The
inject_into
field should be set to
"request_body"
and the
key_name
should be set to
"variables['after']"
. Here is an example of how you can set it up:
Copy code
yaml paginator:    type: "DefaultPaginator"    <...>    pagination_strategy:    type: "CursorPagination"    cursor_value: "{{ headers['urls']['next'] }}"    page_token_option:    type: "RequestBody"    field_name: "variables['after']"    inject_into: "request_body"
In this example, the
cursor_value
is extracted from the
headers['urls']['next']
field of the response. The
page_token_option
is set to
"RequestBody"
to indicate that the cursor value should be inserted into the request body. The
field_name
is set to
"variables['after']"
to specify the exact location in the request body where the cursor value should be inserted. Please note that this is a general example and you might need to adjust it according to your specific API and its requirements. For more information, you can refer to the [Airbyte documentation on Pagination](https://docs.airbyte.com/connector-development/connector-builder-ui/pagination) and [Understanding the YAML file](https://docs.airbyte.com/connector-development/config-based/understanding-the-yaml-file/reference).
f
how does the "body data (urlencoded form)" work in the "inject into" fields in the pagination form ?