Can't find Webhook - app/uninstalled

Abhilash
Shopify Partner
55 0 3
Jonathan_H
Shopify Partner
15 0 5

I am also looking fir this information 

0 Likes
Abhilash
Shopify Partner
55 0 3

I figured it out.
https://help.shopify.com/api/reference/webhook#create


You need to create this webhook via. an API call.
I made the API call and got a success callback with the body which basically gives you the webhook Id, address (your base URL), topic (your webhook end point), etc.
Creating webhooks programmatically is a much better approach since your merchants wouldn't have to do it otherwise.
What I'm stuck in right now is if I press the delete button besides the app, the webhook does not send any notification. I don't know whether it is even possible?

0 Likes
Felix2
Shopify Partner
98 0 16

I use this webhook too and I receive the messages.

Did you try to manually call the callback url that you supply within the webhook?

Looga.io
0 Likes
Abhilash
Shopify Partner
55 0 3

How can I do that? I'm currently using ngrok so that I could debug the code.
My topic is app/uninstalled
address is https://mybaseURL/

0 Likes
Felix2
Shopify Partner
98 0 16

As a first step, I would simply copy the callback url either to the commandline using wget or in the browser and check that your webserver shows a request at all (apache for example -> check the access.log).

I'm not familiar with ngrok. Maybe there are some SSL settings missing?

Looga.io
0 Likes
Abhilash
Shopify Partner
55 0 3

I finally fixed it.

Basically, what I had to do was add an endpoint while registering for the app/uinstalled webhook.

Instead of https://mybaseURL/ only I had to make it https://mybaseURL/app/uinstalled and then listen to the API in the below way.
 

router.post('/app/uninstalled', function (req, res, next) {
  console.log("webhhok called")
});

Note that app/uinstalled is what I used. You can use anything you want. 
0 Likes
Felix2
Shopify Partner
98 0 16

You can also handle all webhooks at the same endpoint, but then you just need to differentiate by the topic header HTTP_X_SHOPIFY_TOPIC.

Looga.io
0 Likes
sohimor
New Member
3 0 0

I'm using the python rest client to `find`, `create` and `delete` a webhook.  When I execute the following I get the exception below.  Is there something I'm missing?  Should I be passing in different params?

shopify.Session.setup(api_key=app_api_key, secret=app_access_token)
shopify.Session(shop_domain, self.SHOPIFY_API_VERSION, shop_token)

# tried both of these
shopify.Webhook.find() or shopify.Webhook.find(id)

File "/Users/user/project/python3.6/site-packages/pyactiveresource/activeresource.py", line 752, in _prefix
    path = re.sub('/$', '', cls.prefix_source)
  File "/Users/user/.pyenv/versions/3.6.7/lib/python3.6/re.py", line 191, in sub
    return _compile(pattern, flags).sub(repl, string, count)
TypeError: expected string or bytes-like object

 

 

0 Likes