Hi
Looking for some examples on API pull using the different options. Could anyone please attach the examples - It's ok if they cannot be run i just want to look at the examples - thanks a lot
Hi @Raj_007
API examples attached. They have placeholders for the elements like keys and such, but it will be helpful for reference.
Thank you so much Brandon. These are really helpful
Dear BrandonBI'm trying to set up OAUTH2 API authentication as per your example. Unfortunately, your example no longer works. You'll be able to see this yourself but the first Download tool (to get the token) returns HTTP/1.1 404 Not Found for the DownloadHeaders. Is this a fault in the workflow or has something changed at the herokuapp end?In the workflow that I'm trying to set up (connecting to our CRM), the DownloadHeaders returns HTTP/1.1 200 but the DownloadData returns <!DOCTYPE html>, not the token that I'm expecting. Could you guess at what I'm doing wrong?Many thanks
@rfgdrake Do you have the API documentation handy? I would try to locate the authentication endpoint, make sure the right HTTP method is being used (GET/POST/etc). A 200 response means you are successfully hitting an endpoint, but could mean that its not the right endpoint. It is also possible that the token is somewhere within that doctype html that needs parsed out although potentially less likely.
I have a writeup on the topic here: https://community.alteryx.com/t5/Engine-Works/APIs-for-Beginners-Integrate-All-the-Systems/ba-p/807437
Dear BrandonThanks for the link. I had already gone through that post. What's frustrating is that I can successfully request the token in Postman but don't seem to be able to translate it to work in Alteryx. I had hoped that looking at the cURL snippet in Postman would help, but I have eight items in my POST code (tokenurl, Content-Type, webapiurl, client_id, client_secret, grant_type, username and password) whilst you have only one. As regarding the API documentation, all I've been able to find is the instructions for setting up the API in Postman, nothing more comprehensive than that. What I was hoping is that you'd be able to fix whatever was wrong with your OAUTH example, and I'd be able to try to replicate it. Are you able to do that?
@rfgdrake each API has different requirements of what it expects for the header and payload so my example is a fairly simple version. All 8 items in your POST code that works in postman will also need to be configured in the download tool. For example Content-Type is normally something like application/json and those likely need to be included in the Headers configuration of the download tool under Name and Value respectively.
If you have it working successfully in Postman, I would suggest getting each of those elements loaded into the Download tool configuration and you should be in a good spot. The download tool is effectively doing a cURL request behind the scenes with the elements that you configure it to use.