Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Using Download Tool for Batch API Post request

AdrianWSH
7 - Meteor

I am trying to use the download tool for a POST API request on a Batch API but when I run the workflow I am getting a response for each line. When I run the request in Postman I receive what I'm looking for (Pic 1) but when running in Alteryx I get what I mentioned above (Pic 2).

 

I've seen post like this where a batch macro is used but it appears this is also making multiple calls instead of 1: https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Iterative-macro-for-API-pagination-ret...

 

Is there a way to send a request that would have multiple lines so that I just get one response instead of individual ones? I've attached the documentation I received for the Batch API.

6 REPLIES 6
AdrianWSH
7 - Meteor

I was able to figure this out.

 

I had to use a summary tool and concatenate my request body so that I just had 1 row instead of the many I had.

lhanson2
6 - Meteoroid

Can you explain how you designed your workflow to make multiple requests? I tried setting the Payload to Take Query String/Body from field and setting variables in the payload and neither was successful.  

AdrianWSH
7 - Meteor

Basically, what I needed was to make one API call to the Batch API instead of the individual calls I was making. So in my first iteration of the workflow I was making a call for each address (figure 1). I used a summary tool to concatenate the addresses into one string using the settings in figure 2.

 

Lastly I used a formula tool to glue everything together onto the full POST request which I then used in the download tool (figure 3).

lhanson2
6 - Meteoroid

Thank you @AdrianWSH ,

 

I will give it a try and provide an update.  Hopefully, it works the same with multiple fields.  

lhanson2
6 - Meteoroid

Looks like the Usgeocoder API will not help my situation.  I'm trying to make a Post call using an input file containing multiple rows of data.  I'm not sure how to parameterize  the payload. There are 2 elements of the body string that is different for each row. 

Here's my workflow:

 

lhanson2_0-1626723076324.png

 

AdrianWSH
7 - Meteor

@lhanson2 

 

Are you trying to use the Geocoder API as a test or do you actually need to pull address information? If you post an anonymized version of your workflow I might be able to help. I'm assuming your trying to make a batch macro?

Labels