Skip to main content
Question

How to add the Acceess token in the http header?

  • February 18, 2022
  • 1 reply
  • 321 views

I add bearer token in Http Header to get user data api show 401 error


Please check below image 1 . I have use api login detail its working and  give accessToken

But When I user trigger for read data I got error 401 I have add Bearer Token in Http Header Show Image 2 Below 
 

Did this topic help you find an answer to your question?
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

Forum|alt.badge.img+9
  • Zapier Staff
  • 331 replies
  • February 18, 2022

If your API has you exchanging a username and password for a token, and you’re meant to include the token to authorize subsequent API requests, you’ll want to look at Session auth, or OAuth 2 if you’re using the application code grant flow. 

Basic auth doesn’t seem like what you’re after. And you won’t be hard coding a token in the header - you’ll reference a variable - something like `bundle.authData.yourToken`. In the UI tool you can type `{{` and get tab completion to pick available variables.