Hi all,
I've been playing around in Alteryx trying to replicate a Postman process. I've so far managed to build an Authorization step by connecting a Text-Input tool to a Download tool (using POST) to generate a Token, and parse it.
Now I want to be able to stream that token in to a new GET download tool (as the token expires every 6 minutes) so I don't have to manually input the Bearer + [Token] each time. I've scoured online guides but I'm just not having any luck. Does anyone have any suggestions?
Thanks!
Solved! Go to Solution.
Use 2 Download tools. The first gets the auth token and stores it in a field. The second takes the value of this field and attaches it as header field
Name the token field from the 1st download tool the same as the header token field name from the API
Dan
Hi Dan,
Currently I have two headers in the second Download tool - Authorization (where the value is supposed to be 'Bearer + Token') and Accept (where the value is 'application/json')
When I run this workflow, but enter the token in to the Header window myself, it successfully downloads the data. But when I have the 'add value from these fields' and pull in the token field, it returns [] in the 'DownloadData' field
I've tried your suggestion and it also just returned [] in the DownloadData field! Not too sure where I'm going wrong, still
Since you've got a space between "Bearer" and your token, you may need to URL encode this in your formula. I don't know if the download tool does this automatically for header values taken from a field
Dan
Just got my API working thanks to this thread. I didn't need to encode the token, but did have to update the column header to match the api documentation. After that, everything worked great!
hi All,
I encountered with the similar issue can any one help me in resolving this.