Ad

GET /admin/webhooks.json Returns An Empty Array

- 1 answer

When doing GET /admin/webhooks.json it simply returns:

{"webhooks"=>[]}

I've created 8 webhooks using the admin panel but I can't seem to access them using the API. If I enter https://SHOP_NAME.myshopify.com/admin/webhooks.json directly into the browser it does return all the webhooks.

Here's the call I'm making using the credentials from a private app:

require 'httparty'

data = HTTParty.get("https://<API_KEY>:<PASSWORD>@<SHOP_NAME>.myshopify.com/admin/webhooks.json", :headers => {'Content-Type' => 'application/json'})

Any idea what I'm doing wrong?

Ad

Answer

The /admin/webhooks.json endpoint only returns the webhooks that you have registered with that API key. That's why I'm seeing an empty array.

Ad
source: stackoverflow.com
Ad