This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I have been trying to use Alteryx to connect to an API to execute automated trades through a cryptocurrency exchange. Unfortunately, I have no experience working with APIs, and I am having a bit of a hard time getting this to work.
Below is a screenshot of my current workflow. It starts by taking the api keys from the text input node on the left (I cannot share these as they are connected to a real account), then creating the variables to pass for the POST request, and sends the request using the download tool.
When I run the workflow, here are the results:
In an attempt to get the API-key to be in the valid format, I converted the two fields into JSON, see screenshot below:
As you can see I didn't do this correctly and I am getting the same error. One theory I have is that the field itself should be named API-key with the two JSON strings for the api keys, but I'm not actually sure how I would get to that structure.
Does anyone have any good resources on using APIs in Alteryx? Or is there anywhere I can go to learn what I need about making API requests in general?
I have attached the workflow screenshotted above, but unfortunately I had to hide the api keys and replaced them with "xxxxxx123" since they are connected to an account with money in it. Although not exactly reproducible and would throw an authentication errror, the message returned by the exchange should say something different than "API-key format invalid" if it were in the correct format.
I would really appreciate any help/insights anyone has to offer!
My tips for API's in Alteryx are to try them out in Postman first, once you've got the set up it's easy to then transfer across. Also look at the CURL code, it's closest to how Alteryx requires the info
In the documentation for this API it states the API needs to be in the headers (the headers tab on the download tool) and the rest goes in the Payload section.
I've set it up how it should be but you can test with your key and secret
Your workflow got the API keys to be accepted, thank you!
I am running into a different issue now on the payload. I changed it to be a POST request since I think that is the correct one, but let me know if that's incorrect.
When I run the workflow:
I was able to isolate the issue and it looks like this is being caused by the "quantity" field. Thoughts on that? If I remove any of the other fields and keep quantity this error persists, but if I remove quantity from the payload I get this message back: