Start Free Trial

Alteryx Designer Desktop Discussions

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

API retrieve

Alteryxuserhere
8 - Asteroid

Hi there
I'm very new to API
Can someone advise how I can build a workflow that can retrieve the orders from here https://humanitix.stoplight.io/docs/humanitix-public-api/468f50b741494-get-orders 

Many thanks!

3 REPLIES 3
OllieClarke
16 - Nebula
16 - Nebula

Hi @Alteryxuserhere 

The best way of translating API documentation into an Alteryx workflow is to find the docs in CURL

image.png

So let's breakdown the above:

  • --request GET
    • This means that we are sending a GET request (the default configuration of the download tool)
    • where to specify request typewhere to specify request type
  • --url https://api.humanitix.com/v1/events/eventId/orders
  •  --header 'Accept: application/json' --header 'x-api-key: 123'
    • These are the headers we need to attach to our call.
    • Accept: application/json tells the api to return a JSON body which we can then parse with the JSON Parse tool
    • x-api-key is the api key which you should have that authorises you to get data out the api. You will need to replace the '123' with whatever yours is
    • You can add these in the headers tab of the download tool:
    • image.png

 

I hope that helps,

 

There's more information about connecting to APIs with alteryx here: https://knowledge.alteryx.com/index/s/article/How-To-Connect-to-the-Connect-REST-API-with-Alteryx-De... 

 

And there'examples and more info on the JSON Parse tool here:

https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/JSON-Parse-to-table/td-p/89158...

https://help.alteryx.com/current/en/designer/tools/developer/json-parse-tool.html

 

Ollie

Alteryxuserhere
8 - Asteroid

Thanks @OllieClarke this is amazing! Is it possible to obtain all orders in one go without retrieving per order?

OllieClarke
16 - Nebula
16 - Nebula

@Alteryxuserhere 

From the documentation, it looks like you would need to first get all the eventIDs (using the get events endpoint - https://humanitix.stoplight.io/docs/humanitix-public-api/476881e4b5d55-get-events). Parse these out, and create your URL in a formula tool using these parsed eventIDs, and then you'd be able to get all your data.

Another great resource for working with APIs is this blog here: https://community.alteryx.com/t5/Engine-Works/APIs-for-Beginners-Integrate-All-the-Systems/ba-p/8074... 

 

Hope that helps,

 

Ollie

Labels
Top Solution Authors