REST API call returns 406 when doing a webhook DELETE

Solved
FedeGala
Tourist
6 0 0

Hi,

I created an app that registers a few webhooks during installation using the "registerWebhooks" method from the NPM package "@shopify/koa-shopify-webhooks". The delivery method in the registration is "EventBridge" and the access token used is the first one generated during installation, which is of access mode "online".

I'm able to make GET calls to "admin/api/2021-01/webhooks.json" using the latest access token for the session, but when I try to do a DELETE on "admin/api/2021-01/webhooks/{webhookID}.json", I'm getting a 406 Not Acceptable back. 

How can I solve this?

Thank you in advance!

0 Likes
Kevin_A
Shopify Staff
Shopify Staff
213 27 39

Hey @FedeGala 

Can you provide us with the x-request-id response header from your delete request please?

Kevin_A | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

FedeGala
Tourist
6 0 0

Hi Kevin,

Of course, here it is: f866c562-e1a3-4d91-a462-837a1ddc540a

Thank you for looking into this!

0 Likes
Kevin_A
Shopify Staff
Shopify Staff
213 27 39

This is an accepted solution.

Hey @FedeGala 

It looks like the issue here is that you are sending the request as a POST instead of a DELETE. Please make sure you are sending a DELETE request. 

Kevin_A | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

FedeGala
Tourist
6 0 0

Hi Kevin,

 

It's always the dumb mistakes that get you. Thank you for pointing mine out! All works now.

0 Likes