Topics covering webhook creation & management, event handling, Pub/Sub, and Eventbridge, in Shopify apps.
I create an webhook via rest API . Here is the code
$add_webhook = array( "webhook" => array( "topic" => "app/uninstalled", "address" => $uri, "format" => "json" ) );
It return
{"webhook":{"id":659696943152,"address":"myurlhere","topic":"app\/uninstalled","created_at":"2019-07-12T23:01:58-04:00","updated_at":"2019-07-12T23:01:58-04:00","format":"json","fields":[],"metafield_namespaces":[],"api_version":"2019-04"}}"
The main problem it when I go to check in :
https://nameshophere.myshopify.com/admin/api/2019-04/webhooks.json
It doesn't had the webhook there.
How can I find what webhook return to the address? Does there had any tool to help ?
Odd, based on the response you've got you should definitely get it in the list. What if you do a get to:
https://nameshophere.myshopify.com/admin/api/2019-04/webhooks/659696943152.json
I get a " ERRORS : Not found"
Are you sure you are using the same auth token to create and get the list of webhooks? If yes, then I am out of ideas, it's either a bug or a misconfiguration in your scripts somewhere.
I believe I use the same token because I use it to create metafields and check
https://myshophere.myshopify.com/admin/api/2019-04/metafields.json
it does have some data. To be more precise about my problem:
When I go check webhook app/uninstall
https://myshophere.myshopify.com/admin/api/2019-04/webhooks/660489535536.json
OR https://myshophere.myshopify.com/admin/api/2019-04/webhooks.json
It get " ERRORS : Not found" . The hillarious part it when I use the API
GET /admin/api/2019-04/webhooks.json
It does return the webhook
{"webhooks":[{"id":660489535536,"address":"https:\/\/5b682779.ngrok.io\/code\/myfirstphpbackend\/tutorial_5\/deleteuser","topic":"app\/uninstalled","created_at":"2019-07-15T21:43:19-04:00","updated_at":"2019-07-15T21:43:19-04:00","format":"json","fields":[],"metafield_namespaces":[],"api_version":"2019-04"}]}" }
I just want to get email and domain value when I uninstall the app. But it get 500 internal server error even when in the file only had
<? php echo '1'; ?>