Hi Alteryx Community,
I am working on creating a Batch Macro to retrieve contact information using the following API:
https://api.hubapi.com/contacts/v1/contact/vid/" + [vid] + "/profile?property=firstname&property=lastname&property=email&property=phone
Scenario:
- I have a dataset containing a large number of vids (e.g., 200,000 rows).
- Each vid corresponds to a unique contact, and I need to make an API call for each vid to fetch the details (firstname, lastname, email, phone) dynamically.
- Since there’s no pagination in this API, I’m considering a Batch Macro to process this data in manageable chunks or batches.
What I've Done So Far:
Input Data:
I have a list of vids in a column, stored as part of my workflow input.
API Configuration:
The API endpoint dynamically appends the vid to the URL. I plan to construct the URL using a Formula Tool:"https://api.hubapi.com/contacts/v1/contact/vid/" + [vid] + "/profile?property=firstname&property=lastname&property=email&property=phone"
Authentication:
I have already set up an API key and tested the endpoint successfully using a cURL tool.
Goal:
Create a Batch Macro that:
- Loops through each vid.
- Makes a call to the API for each vid.
- Processes and appends the results into a consolidated dataset.
Challenges:
Control Parameter Setup:
I understand that the Control Parameter tool is used to dynamically pass values (in this case, the vid values) into the macro, but I’m not sure how to configure it correctly.
Macro Workflow Structure:
I’m unsure how to set up the tools within the macro for:
- Constructing the URL dynamically.
- Sending the API request using the Download Tool.
- Parsing the API response.
Batch Configuration:
How do I ensure the macro processes the data in batches or iteratively handles all vids?
Please help me.
Thank you!