Hi everyone, i am building custom connector for S...
# help-connector-development
r
Hi everyone, i am building custom connector for ServiceDesk Plus and having trouble in implementing pagination
Copy code
<https://mydomain.com/api/v3/endpoint?input_data={>"list_info":{"start_index":1,"row_count":"2000","get_total_count":true}
this is how they expect us to pass data for pagination, can someone guide me on this please ?
k
A message from kapa.ai
To implement pagination for your custom connector in Airbyte, you can use the information provided in the [Pagination section of the Connector Builder documentation](https://docs.airbyte.com/connector-development/connector-builder-ui/pagination). Since your API uses a custom format for pagination, you'll need to disable the injection in the pagination form and use the generic parameter section at the bottom of the stream configuration form. You can use jinja expressions and [available variables](https://docs.airbyte.com/connector-development/config-based/understanding-the-yaml-file/reference/#/variables) to configure the request parameters. In your case, you can create a request parameter with key
input_data
and value
{"list_info":{"start_index":{{ next_page_token['next_page_token'] or '1' }},"row_count":"2000","get_total_count":true}}
to inject the start_index from the pagination strategy. Here's an example of how you can configure the pagination:
Copy code
yaml paginator:   type: DefaultPaginator   page_size: "#/definitions/page_size"   limit_option:     inject_into: "request_parameter"     field_name: "row_count"   page_token_option:     type: RequestOption     inject_into: "request_parameter"     field_name: "start_index"   pagination_strategy:     type: "OffsetIncrement"     page_size: 2000
Then, in the generic parameter section, configure the
input_data
parameter:
Copy code
yaml request_parameters:   - key: "input_data"     value: '{"list_info":{"start_index":{{ next_page_token["next_page_token"] or "1" }},"row_count":"2000","get_total_count":true}}'
This configuration should help you implement pagination for your custom connector in Airbyte.
r
@kapa.ai Is there any way to do it in the UI ?
k
A message from kapa.ai
Hmm, I don't know enough to give you a confident answer yet. However, you can find helpful information in the Airbyte documentation [here](https://docs.airbyte.com).
j
@Rishav Sinha This is not supported as a top level concept, but you might still be able to make it work like this:
Enable pagination and set the limit
Then, set a custom request parameter at the bottom of the form that sets input_data:
Screenshot 2023-05-31 at 09.36.05.png
{"list_info":{"start_index":"{{ next_page_token. next_page_token or 0 }}","row_count":"2000","get_total_count":true}
As you can see, it's using the {{}} syntax to fill in placeholders and the next_page_token variable: https://docs.airbyte.com/connector-development/config-based/understanding-the-yaml-file/reference/#/variables/next_page_token
r
Awesome @Joe Reuter (Airbyte) you are a life saver, it worked perfectly. Thanks a lot