I want to use the builder to query an API. I want ...
# replication-ask-ai
j
I want to use the builder to query an API. I want the user to be able to configure a list of strings as an input, and Airbyte should query the API with each string of the list inside the url. (it is not a query parameter, it is in the url path). How can I do it ?
k
Here's how to achieve this in the Connector Builder: 1. Create a User Input for the List Add a user input of type array (e.g., named
my_ids
) so users can provide their list of strings when configuring the connector. [Partition Router Types] 2. Configure a List Partition Router On your stream, add a List Partition Router with the following settings: • Partition Values: reference the user input →
{{ config['my_ids'] }}
• Current Partition Value Identifier: choose a name, e.g.,
my_id
This will iterate over each string in the user-provided list. [Partition Router Types] 3. Inject the Value into the URL Path Since the value goes into the URL path (not a query parameter), do not use the "Inject into outgoing HTTP request" option in the partition router form. Instead, directly reference the partition value in your stream's URL Path using Jinja interpolation:
Copy code
/your/endpoint/{{ stream_partition.my_id }}/details
Replace
my_id
with whatever you set as the Current Partition Value Identifier, and adjust the path structure to match your API. [Partition Router Types] Summary of the flow: 1. User provides
["value1", "value2", "value3"]
in the
my_ids
config field. 2. The List Partition Router iterates over each value. 3. Each iteration makes a request to e.g.
/your/endpoint/value1/details
,
/your/endpoint/value2/details
, etc. šŸ‘ 0 button šŸ‘Ž 0 button ā„¹ļø Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.