cancel
Showing results for 
Search instead for 
Did you mean: 

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

SOLVED
Jay2022
Asteroid

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

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
Jay2022
Asteroid

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

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.

 

 

apathetichell
Arcturus

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

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.

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

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

Highlighted
apathetichell
Arcturus

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

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.

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

@apathetichell  that makes sense, will try and update