Question

Posting webhook results in "unauthorized" response

  • 27 September 2022
  • 11 replies
  • 190 views

Userlevel 1

I am unable to post a webhook to Roboflow. Below screenshot shows the request that Zapier is making and the documentation from Roboflow below. I can get this to work without any problems with Postman, but unable to with Zapier which always throws the error “unauthorized”.

 

 


11 replies

Userlevel 7
Badge +9

Hey there, @Picto! I hope you don’t mind - I’m moving your question over to our Code & Webhooks forum to see if we can get some more technical peepers on your question. 🙂

Thanks for reaching out in the community! 

Userlevel 1

👋 Co-founder of Roboflow here. I’ve never used Zapier to trigger a webhook to our inference API before but really neat idea!

A couple of things jump out at me:

  1. I’m not sure what other `payload_type` options there are besides `form` but our API expects those parameters to come in via the query string; I’m wondering if this is POSTing them as part of the request body. Getting `unauthorized` sounds like it’s not even able to read the API key & is what you’d get from just hitting the naked model endpoint eg: https://detect.roboflow.com/xyz/123
  2. I don’t think this is yet the problem (but you’ll likely run into it next), I don’t think our backend supports parsing `webp` format currently; we’ll look into it (I think it requires a dependency to be added to our API servers). Although if it’s working via CURL this might work out of the box (please let me know if so, that’d be fun to learn!)
Userlevel 1

 

This is what the options are for Payload Type.

 

Userlevel 1

Here a better view of the headers etc.

Userlevel 1

Is it possible to dynamically construct the URL? Or is the `Data` section the only place you can put variables?

Userlevel 1

I’ve tried to define api_key and image as headers, but that doesn’t work either.

Now, things work great when I use Postman.com, so there the endpoint works, it’s just Zapier that constructs is differently.

Let me post from Zapier to Postman to see what is being submitted.

Userlevel 1

I’ve just tested with Postman and Zapier sends JSON as request body while payload type is set to Form...

I am about to give up on Zapier...

Userlevel 1

I finally got it to work. Below the solution for anyone else who wasted hours getting Zapier to work properly.

I setup a custom request of method POST (not really custom, but okay), Then I was able to specify one long URL and include the image in there.

 

 

Userlevel 1

Nice, glad you got it working!
 

Any interest in writing a guide on using Zapier with Roboflow?

I finally got it to work. Below the solution for anyone else who wasted hours getting Zapier to work properly.

I setup a custom request of method POST (not really custom, but okay), Then I was able to specify one long URL and include the image in there.

 

 

Awesome work! Sorry you had to go through that experience, but this is a promising development!

Userlevel 1

Nice, glad you got it working!
 

Any interest in writing a guide on using Zapier with Roboflow?

 

I am not there yet. Problem with the custom request is that Roboflow’s JSON response is passed as plain text by Zapier (all the JSON formatting is gone). Apparently, that doesn't happen when going for a regular POST (instead of custom request).

I’ll be trying Integromat as an alternative to Zapier, which was surprisingly hard to setup.

Reply