Simon Veerman
10/28/2024, 2:39 PMuser
10/28/2024, 2:40 PMarray
- Set "Current Parameter Value Identifier" to a relevant name (e.g., account
) - Configure "Inject Parameter Value into outgoing HTTP Request" to inject the account ID into your URL parameter For example, if your Orders stream URL is something like <https://api.example.com/orders>
, you would set the "URL Path" to /orders?account_id={{ stream_partition.account }}
. This setup is similar to the example provided in the [Airbyte documentation for parameterized requests](https://docs.airbyte.com/connector-development/connector-builder-ui/partitioning#example). 2. Stream Slicing: If you're developing a custom connector, you can use the concept of stream slicing. This allows you to break down a large sync into smaller chunks, which in your case would be individual account IDs. You would implement this in the stream_slices
method of your stream class. For each account ID, you'd generate a slice, and then use that slice in your path
or request_params
method to construct the appropriate URL. This approach is mentioned in the [Airbyte documentation on stream slices](https://docs.airbyte.com/connector-development/cdk-python/stream-slices). 3. API Approach: If you're using Airbyte in a more programmatic way, you could potentially use the Airbyte API to create multiple sources, one for each account ID. However, this might be more complex and less maintainable than the above options. Given your specific requirements, I would recommend using the Parameterized Requests approach if you're using the Connector Builder UI, or the Stream Slicing approach if you're developing a custom connector. These methods will allow you to efficiently sync data for multiple account IDs without having to manually create separate jobs for each one.Simon Veerman
10/28/2024, 3:00 PMSimon Veerman
10/28/2024, 3:00 PMuser
10/28/2024, 3:00 PMuser
10/28/2024, 3:00 PMcode
and type
fields is guaranteed to be unique. In your case, you would set the "Primary key" to "`merchant`, `id`". This tells Airbyte to use both the "merchant" parameter (which comes from your input) and the "id" field from the response to create a unique identifier for each record. By setting up the primary key this way, you ensure that: 1. Each record is uniquely identified by the combination of the merchant and the id. 2. Downstream systems can use this composite key for deduplication and proper handling of the data. 3. If you're using an incremental sync mode like "Append + Deduped", Airbyte will be able to correctly identify and handle updates to existing records. Remember, this setup allows for automatic downstream deduplication of records based on the values of these two fields, as mentioned in the [Airbyte documentation](https://docs.airbyte.com/connector-development/connector-builder-ui/record-processing#meta-data).