Alteryx Designer Desktop Discussions

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

How to pick API "token access value" to POST data

Jay2022
8 - Asteroid

Hi,

 

I have this workflow where I need to pick up the API access token value to be able to POST to the API site. So far I haven't been able to be successful loading the data as I am getting error 405. Attachd is what my workflow looks like.

 

 

4 REPLIES 4
apathetichell
18 - Pollux

parse your download data as json using a json parse tool. pick out the token value based upon the json name value (usually something like token) - pass this field downstream as your new token. Often you will use a formula tool to attach a prefix like "Bearer: - "+[jsonValue]. use Postman to get your syntax correct.

Jay2022
8 - Asteroid

@apathetichell  can you give me an example of what it would looks like?

apathetichell
18 - Pollux

Can you clarify - what kind of example are you looking for? 

 

For example - my downloaddata from Blackline's token endpoint is a json file which I use Json Parse to extract:

access_token
expires_in
token_type

 

I then filter for the field of "access_token" and take the token value. I rename it token - use a formula tool to create a new field called Authorization with configuration of:

"Bearer "+[token]

 

I then feed this into download tool 2 as my Authorization.

 

This may not work for you because I do not know what API you are using. If you include that information - I may be able to identify the json field the token would be in.

Jay2022
8 - Asteroid

@apathetichell  that makes sense, will try and update

Labels