Bridge: Data Reference Doesn't Return Same as Hardcoded Value
I'm connected to an external API that requires a token to be added as a Request Header for calls. The token cannot be hardcoded to the call since it expires every hour. So I must make a call to refresh the token then use that in subsequent call's Header.
When I pass the token as a data reference to the Header of the subsequent call, the API returns a 401 error. (For the screenshot below I removed the first call to get the token and I'm just passing the token string from the JS). I get the same error whether it comes from the JS or from the call directly.
But when I provided the token directly in the Value, it returns 200 success…
Do I need to "clean" the Bridge data reference somehow? I'm stumped.
Answers
-
Leaving this out there for anyone that comes across it…
I solved for this by bringing the first call's result (token) into JS and prefacing it with the 'Bearer ' in the same variable and returning that as a single data point. I then referenced that in the Header Value field of the subsequent call.
-
That's interesting Ryan. Do you think it's because you ended up with something like
'Bearer 'token' ' ?
-
@Brian_Richardson unfortunately, it doesn't show me the data it sends, so I'm not sure, but I'm guessing it was either that or it was adding quotes around the token text.
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.5K Get Help
- 402 Global Discussions
- 213 Industry Talk
- 450 Announcements
- 4.7K Ideas & Feature Requests
- 141 Brandfolder
- 135 Just for fun
- 56 Community Job Board
- 454 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 296 Events
- 36 Webinars
- 7.3K Forum Archives