Question

Error "401 Unauthorized" When attempting GET with Webhooks by Zapier

  • 26 January 2024
  • 16 replies
  • 314 views

Hello All! I am in the process of setting up an API integration using “Webhooks by Zapier.”

*The purpose of the zap is to pull order history data from an external source.*

  1. I first used a POST request to login to the external API endpoint, this returned a successful test.

 

  1. I am next attempting to use a GET request to pull the order history. As per the external sources API documentation, the “accountId” is required in parameters, so i included this. I also added basic auth in the request but am still getting 401 Unauthorized. 

**We have tried getting rid of the initial POST request to login, and putting the basic auth in the GET all together but still resulting in this error. 

Does anyone have any advice, or encountered a similar issue and had successful troubleshooting?


16 replies

Userlevel 7
Badge +14

@ZapUser_020801 

We would need to see screenshots with how your full GET request is configured along with the link to the API endpoint docs you are referencing to configure the webhook step.

@Troy Tessalone 

The API Documentation I am referencing is: https://beaconproplus.com/swagger/v1/

See screenshot below for how my GET request is configured, (accountId and Basic Auth covered for user privacy) 

I have even tried adding a space between the pipe | and credentials, and also tried putting accountId parameter in URL. Getting “401 Unauthorized” either way

 

Userlevel 7
Badge +14

@ZapUser_020801 

Try adding a Header

Accept: application/json

https://beaconproplus.com/swagger/v1/#/Order%20History%20Services/get_orderhistory

 

 

@Troy Tessalone This is not responding with order history from the account, no matter if i put Basic Auth or not. It is responding with this: 

(Using Postman to test)

 

There will need to be some sort of credential authentication because we are pulling the order history

Userlevel 7
Badge +14

@ZapUser_020801 

The recent screenshots is from Postman, which can have different behavior than the request in Zapier.

@Troy Tessalone I am getting the same response in Zapier. This is not pulling order history from the account i authenticated with, it is only giving me links from the Swagger page.

 

Userlevel 7
Badge +14

@ZapUser_020801 

We would need to see updated screenshots with how your Zap step is configured to have full context.

@Troy Tessalone It is still configured the same way, i just changed the URL to the one you previously noted in your comment. 

https://beaconproplus.com/swagger/v1/#/Order%20History%20Services/get_orderhistory

 

I even try putting the authenticators in the headers: 

And still getting the same STATIC response: 

 

Userlevel 7
Badge +14

@ZapUser_020801 

It’s likely due to the URL.

 

The previously provided link was to the API docs for the specific endpoint you are using indicating reference to the Header (Accept = application/json) that you may need to add, which was not meant to be used as the request URL in the Zap step config.

https://beaconproplus.com/swagger/v1/#/Order%20History%20Services/get_orderhistory

@Troy Tessalone I am now getting Error Code 500

 

Userlevel 7
Badge +14

@ZapUser_020801

Check your URL, that doesn’t look like it matches to one from the API docs.

 

For reference this is what you had before in a screenshot.

 

@Troy Tessalone My apologies! I forgot to take login out before calling order history. I can confirm that i am still getting the 401 Unauthorized error with the added header.

 

Userlevel 7
Badge +14

@ZapUser_020801 

Can you link to the API docs section that references how to handle authentication?

@Troy Tessalone This is the only thing i see regarding authentication, besides the login call. I tried putting the login POST call as a separate step in the zap, but it is not carrying over the session cookie in the background to the second step. This is why i was trying to put the basic auth in the GET call to do the authentication and request all in one step. 

 

Userlevel 7
Badge +14

@ZapUser_020801 

I’d recommend reaching out to the app’s Support to get guidance on how to handle authentication for their API requests along with specific examples.

Authentication may require the another Header.

Authorization = Bearer TOKEN

 

Reply