ALTERYX INSPIRE | Join us this May for for a multi-day virtual analytics + data science experience like no other! Register Now

Alteryx Designer Discussions

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

Using an API for cryptocurrency trading in Alteryx - Incorrect Format

ries9112
7 - Meteor

Hey everyone,

 

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. 

alteryxQuestion1.JPG

When I run the workflow, here are the results: alteryxQuestion2.JPG

 

In an attempt to get the API-key to be in the valid format, I converted the two fields into JSON, see screenshot below:alteryxQuestion.JPG

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 am using the Binance Exchange API:

I could also use the KuCoin Exchange API if that is easier for whatever reason: https://docs.kucoin.com/#permissions

 

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!

Ricky

LordNeilLord
15 - Aurora

Hey @ries9112 

 

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

 

 

ries9112
7 - Meteor

@LordNeilLord Thank you for your quick response and help!

 

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: alteryxQuestion3.JPG

 

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: 

alteryxQuestion4.JPG

 

I really appreciate the help!

Ricky

 

LordNeilLord
15 - Aurora

Hey @ries9112 

 

not sure about that one looks like you've set everything up ok.

 

Unfortunately I can't test without an API key

 

 

Labels