415 Error when attempting to create webhook

When attempting to create webhooks for two of my customers, I’m receiving a 415 error. Why is this?

Here’s a partial sample of the code that should explain what I’m trying to do

url = 'https://api-proxy.pipedrive.com/webhooks'
webhook_attrs = { subscription_url: "#{Rails.application.secrets.webhook_url}/stages",
                  event_action: '*',
                  event_object: 'stage',
                  http_auth_user: 'omitted',
                  http_auth_password: 'omitted' }
user_auth_headers = { 'Accept': 'application/json',
                      'Accept-Encoding': 'utf8',
                      'Authorization': "Bearer #{@access_token}" }
response = RestClient.post(url, webhook_attrs, user_auth_headers)

Error thrown is:

 "error"=>"Unsupported Media Type",
 "message"=>"Internal Server Error (138d2d8e-d6bb-426b-bf3d-7e0540a7cf9a)"}

I tried using the access_token to get a deal and a person and it worked correctly, so it appears I’m authenticated.


Hi @Kenton ,

Could you also add Content Type header


to request headers and try again?

It’s fixed now. I didn’t add the header, but the request now works.

1 Like