Alteryx Designer Desktop Discussions

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

Need Macro for batch API calls

Beedge
5 - Atom

Hi -

 

Alteryx newbie here (3 weeks and counting).  I am working on pulling data from an API that only allows 100 records at a time.  I am hoping someone can help with a macro that can split my API calls into batches of 100 at a time.  Attached is my workflow that includes the sample tool to limit the call to 100 records which I would be removed in place of the macro.

 

Thanks for your help!

Brian

3 REPLIES 3
FláviaB
Alteryx Community Team
Alteryx Community Team

Welcome to the Alteryx Community, @Beedge

Great question! For more visibility, I am moving your post to our Designer Discussions board so you can have all the support you need. 

 

Keep solving!

Flávia Brancato
BrandonB
Alteryx
Alteryx

@Beedge I have to say I am very impressed that you are already tackling API calls being 3 weeks into using Alteryx! The good news is that you don't need a macro at all because the download tool can process multiple API calls. All that you have to do is dynamically split them into groups of 100 records and feed those lines into the download tool with the other steps that you have already completed. I also cleaned up your JSON Parsing a little bit with some techniques that require less tools. The text to columns on the JSON Name comes in handy! 

 

Here is what I put together for you: 

 

API call.png

 

I have also attached the workflow that I put together for you below. I would also suggest that you change the API password when you get a chance so that others can't access the data. 

 

Let me know if this helps!

Beedge
5 - Atom

Thanks a lot for your help!  Yep, I am an Alteryx newbie and admittedly haven't spent enough time reading about the tools (more trial and error).  I didn't realize that the download tool could accept multiple rows (rather than using a macro).  Way simpler.  And thanks for cleaning up my JSON parsing.  I was quite certain there was a better approach there, so your insight is appreciated.

 

And good call on changing the API password.  I did create a temp user with very limited access so anyone helping could ensure their solution worked, so I will disable that now that I have a working workflow.

 

Have a good one!

Beedge

Labels