Skip to main content
Best answer

Change basic-auth to bearer tokin in webhook


I’m build a zap to interact with a REST API calling a GET method and putting the information on google sheets.

 

The API uses Bearer Token method to authenticate. In webhook form, I only can set basic auth. 

 

How can I change the authenticate method to Bearer Token?

 

Best answer by Troy TessaloneBest answer by Troy Tessalone

@Caio Ferreira 

You appear to be using a REFRESH Token but likely should be an ACCESS Token.

I’d reference the APIs documentation to better understand the 401 and 403 errors you were getting.

View original
Did this topic help you find an answer to your question?

8 replies

Troy Tessalone
Forum|alt.badge.img+14

Hi @Caio Ferreira 

You can set in the Headers section at the bottom.

Left Side: Authorization

Right Side: Bearer [TOKEN]


Hi @Troy Tessalone 

Thanks for answer.

I tried and returned HTTP 403 - Forbidden.

So, I tried to without “Bearer” before the token and returnd 401 - Unnauthorized

 


Troy Tessalone
Forum|alt.badge.img+14

@Caio Ferreira 

Can you share screenshots of how your Webhooks step is currently configured?


 

 


Troy Tessalone
Forum|alt.badge.img+14
  • Zapier Expert
  • 31139 replies
  • Answer
  • May 5, 2021

@Caio Ferreira 

You appear to be using a REFRESH Token but likely should be an ACCESS Token.

I’d reference the APIs documentation to better understand the 401 and 403 errors you were getting.


Thanks!

 

I formated the field to change the word “REFRESH” to “AUTH” and works!.


  • New
  • 1 reply
  • September 8, 2021

I’m seeing the same issue. I even just tried to hardcode a valid access token in the header and continue to see the same 403 issue. Any inputs? 

 

 


Michael Lucas
Forum|alt.badge.img
  • Zapier Expert
  • 31 replies
  • September 9, 2021

Hi @Harsha 

 

It will largely depend on the type of API token the specific API authentication is looking for, but one way to convert a 'basic auth' code into a valid token is using the base64 encoder:

https://www.base64encode.org/

 

For example you can convert a basic auth sequence like below into a readable 'basic' token by entering into the coder to produce the required token string, then use the header 'Authorization' and output of 'Basic xxxxxxxxxxx' from the encoder.

 

Regards, Michael

consumer_key:consumer_secret

Reply