Alteryx Designer Desktop Discussions

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

Python, Jupyter and Rest API with Auth0

MarkBurns
7 - Meteor

Hi 

 

New Alteryx user here!  Just dipping my toe into the world of workflows and I have to say I like it so far!

 

I'm trying to get some CRM data from an Auth0 Rest API, and searched the community and found this Zoom rest API into Alteryx as a possible solution to get the bearer token

 

Not sure if I've gone down a rabbit hole but I've done the following

 

  • Installed Python 3.8
  • Installed Jupyter and was able to connect to the local host and execute the following
    • import pandas as pd
      data = pd.DataFrame({"text": ["Jupyter", "by", "itself"], "number": [1,2,3]})
      data

When I'm back into Alteryx (Non-Admin Designer) Version: 2021.3.1.47945, the Jupyter notebook doesn't open. I have try

 

  • Run Alteryx in admin mode
  • Edit Internet Options and enabled proxy, pointing at local host (now removed as it didn't work)

 

My question is, do I need to use Python to obtain the Bearer Token for API call or is there a different way to do it?  If I do need python then why doesn't the notebook open - have I missed some configuration option.

 

At the moment my workflow only consists of Python tool, so not much to share.

 

I have managed to connect Alteryx to the Public API and process the JSON data into a usable form....

 

Any suggestions or signposting.

 

Thank You

 

Mark

 

 

 

 

17 REPLIES 17
MarkBurns
7 - Meteor

Ok, sounds like a plan and something for tomorrow.

 

Thanks for the help and I'll reach out to our contact at Alteryx.

 

apathetichell
19 - Altair

@MarkBurnsOne thing I'd also recommend is looking at (ie opening the underlying macros) in the token transfer API based macros  which are bundled into "tools" - specifically the Box Tool and the Google Sheets Input Tool. Both show you token transfer strategies from linked download tools.

BrandonB
Alteryx
Alteryx

I put together an "APIs for beginners" guide: https://community.alteryx.com/t5/Engine-Works/APIs-for-Beginners-Integrate-All-the-Systems/ba-p/8074... 

 

Hopefully that gets you headed in the right direction. To answer your question, you use the first download tool to hit the authorization endpoint which should return a bearer token. You then parse this result out of the DownloadData column to be used in a subsequent call. Normally you need to use a formula tool to create a new column called "Authorization" which you put the word Bearer and then the token that returned from the call. You also use a formula tool to specify the next URL to be called by a subsequent download tool. In this next download tool, you can check the box for the authorization column in the "Headers" tab so that this bearer token is leveraged in the authentication of the next call. I have an example outlined in the link above. 

apathetichell
19 - Altair

On the "Postman is your friend" tip -A few days ago I was inspired to try to figure out what went wrong here since I was playing around with some authentication issues I was having: https://www.thedataschool.com.au/fabrice-joseph/querying-the-pleiades-api-historical-places-dataset/

 

I don't know the author ( @fabricejoseph ?) but I can tell you that you can get the download tool to work in Alteryx IF you hardcode

User-AgentPostmanRuntime/7.28.4

 

in the download tool header - still shows up as moved but the data comes through. I bring this up because Postman is your friend here and you may need to change things you would never think of changing.

MarkBurns
7 - Meteor

Thanks @BrandonB 

 

That's exactly what I needed.  If I can keep the workflow code free that would be ideal. 

 

Thankfully I have pretty much a free day today to explore this and like @apathetichell suggested I will attempt to build the call in postman so can see what's happening. I do have a working PowerShell script that I wrote, so fingers crossed that enough!

 

Feel like I'm moving in the right direction, which is awesome.

 

Cheers also to @TheOC for the advice

MarkBurns
7 - Meteor

Just wanted to post an update and to say thanks to all especially @BrandonB  for posting that API guide and for @TheOC  and @apathetichell  offering advice. This is a major mile stone for me,  just for info: I work for Leeds Beckett University and this integration is for CareerHub which is the CRM used Student Services, I have been trying to tackle this problem for the past few years and spent many hours looking at PowerShell solution - which works but never quite fitted my needs. 

 

Any one who works in HE know that departments / schools / faculties  are independent lot and don't always get support from the institutional IT Department for non-priority projects, so being able to tackle this independently is awesome.

 

Thought others would be interested in how approached this, I'd like to share the workflow but it's got credentials hardcoded into it, so hope this screenshot helps.

 

MarkBurns_0-1638982766178.png

 

Nice way to finish a Wednesday in rainy Yorkshire.

 

BrandonB
Alteryx
Alteryx

Great work @MarkBurns!

TheOC
15 - Aurora
15 - Aurora

hey @MarkBurns 

Nice to hear you got it sorted! @BrandonB coming through with the fantastic resource.
You're not all too far from me, I'm up in Newcastle, the 'rainy Yorkshire' totally resonates 😂

 

I think thats one of my major loves of Alteryx - opening the doors to those exact 'non priority projects', I'm glad it could for this one too, and thanks for sharing the screenshot for anyone else who comes across this thread with a similar issue.

Cheers,
TheOC

Cheers,
TheOC
Connect with me:
LinkedIn Bulien
Labels
Top Solution Authors