Alteryx Designer Desktop Discussions

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

Authorization token passed as a variable?

Archaeopteryx
ファイアボール

Hi,

 

In the Download Tool's Header tab, is it possible to pass the Authorization token as a variable rather than a literal string? 

 

I'm pulling down and capturing an Access Token, that I have named [RawToken], which has a 48 hour life span, from a server using an API. I would like to use the variable [RawToken] as the Authentication key in the Header tab of the Download tool. I have tried surrounding the name with brackets, then with braces, then with parenthesis. In my Results pane, I get the message "No authentication bearer token specified in authorization header". 

 

Is it not possible to pass that token as a variable? 

 

Thanks

Chris

 

  • API
2件の返信2
patrick_digan
17 - Castor
17 - Castor

Hi @Archaeopteryx I think I can help. There are 2 ways to pass headers: constants and fields. It sounds like you'll want you to use the fields section on the bottom of the headers tab:

patrick_digan_0-1608239292822.png

 

The important thing is that you have to name your field appropriately as the field name is sent over in the call. So in your case, you may need to use a formula tool to create a field called "Authorization" and the formula would set it to [RawToken]. Or you could use a select tool to rename RawToken to Authorization.

 

Hope that helps! 

 

EDIT: as an example, I have a workflow where I've hardcoded the content-type:

patrick_digan_0-1608239575569.png

I could switch it to a variable like so:

A formula tool to set the variable. Here I'm just hardcoding it, but it could reference another column

patrick_digan_1-1608239625980.png

 

And then my download tool to use that:

patrick_digan_2-1608239664891.png

 

Archaeopteryx
ファイアボール

Patrick,

Thank you. "And values from these fields:" and renaming the field to "Authorization" did the trick. 

Chris

ラベル