Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Algorithmia API help

KaiLarsen
9 - Comet

Hi!

 

Trying to get the Algorithmia API work in Alteryx. Unfortunately, it requires R 3.3. Easy to get it working in R.

 

library("algorithmia", lib.loc="/Library/Frameworks/R.framework/Versions/3.3/Resources/library")

 

Any thoughts? Can I update the Alteryx R version without Alteryx imploding?

 

Kai :-)

 

7 REPLIES 7
KaneG
Alteryx Alumni (Retired)

Technically, you can. However if you have R installed previously, then that can cause issues occasionally. 

 

For the Algorithmia API, have you tried the rest interface with the Download Tool? http://docs.algorithmia.com/#introduction

 

Kane

KaiLarsen
9 - Comet

I have now...for hours... Sigh. All the examples I can find for the download tool are essentially for downloading a csv file from the web. This is quite a few steps beyond that.

KaneG
Alteryx Alumni (Retired)

Try the attached. You'll need to replace the API Key and you can also replace the name. 

 

Basically, the Auth is Simple and so you just make a field called 'Authorization' with the word Simple followed by a space and then your API Key. (Note: If it was Basic Auth then you would have the word Basic followed by Your API Key Base64 encoded)

 

For the -d from the CURL statements, I constructed this as a query string. If you just submit the fields as payload then it'll appear as 'Your_Name=kaneg", but it'll still work. The reason I've set it up as a field for the query string is that you'll have to construct JSON parameters into a field and then POST that as the query string.

 

I've essentially made this call:

curl -X POST -H 'Authorization: Simple YOUR_API_KEY' \
    -d 'HAL 9000' -H 'Content-Type: text/plain' \
    https://api.algorithmia.com/v1/algo/demo/Hello/

Let me know if it is still not clear.

KaiLarsen
9 - Comet

You rock, Kane. I'm so close I can smell it. I'll follow up with a screenshot of what I get back. It accepts the input, but I suspect it is not getting the text I want it to parse. I've attached my workflow in case that helps.

KaiLarsen
9 - Comet

Here is the screen shot.

KaneG
Alteryx Alumni (Retired)

I've confused things a little there... Composing the Query/String Body would still work if the query wasn't important (such as in the Hello sample), however it is important here...

 

You need to 'Take Query String/Body from Field' on the Payload tab, otherwise it's trying to send 'Input="This system is easy to use"' rather than just "This system is easy to use".

KaiLarsen
9 - Comet

You are brilliant, @KaneG! TRULY appreciate your help with this!!

 

Kai :-)

Labels