This is driving me bonkers! I've literally rewrote my func four times to try and understand why I'm not receiving an uninstalled event.
Ok, So, I'm testing locally via ngrok. I've spent the best part of the day wiring up the auth, all is working fine except, uninstalling.
I log the response from the api (looks good), I can see the hook via postman (GET request)
I've stripped out all the code on the uninstalled endpoint on my mvc app and I'm left with:
public IActionResult Index()
return new OkResult();
It's just not being hit.
Please can someone point me in the right direction?
Solved! Go to the solution
Anyone else seeing these problems? I really could do with a tech rep from shopify to help identify the issues.
I've tested again this morning, leaving the dev/ngrok server running incase of delay... but 30mins in, and still no data received.
Are there any reported issues using ngrok in a test env? How can I tell if the shopify system even attempted to make this call? Happy to share further details in a private message.
If your App is not getting hit with a webhook, 99% of the time the problem is, you have not configured your App correctly. So you say Postman registers the hit. Great. Now when you examine the webhook you setup in the App you're about to uninstall, you are 100% certain you did that step correctly, and you see your topic and endpoint perfect right?
Only in that case would I even pretend there is a problem with Shopify... 99% of the time, the problem was me. And what I did. And the DUH moments are there.
Thank you very much for the reply. It's truly appreciated.
I completely agree that mistakes and bugs can happen. My day job is a software engineer, so I'm well versed in the art of developing systems.
So, My auth is working. During the callback process, I call the POST webhook endpoint, which certainly creates the hook. The resp from the call:
I also store the config to a table:
And finally when I get all webhooks using postman, I can certainly see the one I created:
I've now included a logging method and left my dev server running:
public async Task<IActionResult> Index()
_loggerHelper.Log(LogType.Database, "UninstallController.cs", "Uninstall", "Uninstall Endpoint Hit!");
return new OkResult();
You say not configured app? Are you referring to the app in shopify (Create App section). Do I need to whitelist some where?
And finally if I take my url "uninstall" change the verb to post in postman, I can hit my own app... I really wish there was a "DUH" moment but I'm not seeing it.
What I meant is, your App is probably not configured properly at the endpoint. Shopify is almost certainly sending you the webhook if you are uninstalling the App. If your endpoint remains unhit, it is likely you are either not listening to the right endpoint with the right verb... or something else is misconfigured. As I said before, there will likely be a duh moment for you.
There is nothing to whitelist. If you set a webhook in an App, and you checked it exists, and you trigger it, you should receive it. In your case, not receiving it is probably due to a config.
Still not found the issue, it makes it tremendously difficult if I cannot see what's being returned when shopify attempts to make the call. Surly there's an event stream somewhere?
Taking a screen shot of my dashboard, If the fail rate is at 0.0 (and assuming I have a problem) that should be greater than zero.
Their needs to be more tools to understand the problem. If you say 99% of the time it's user error and shopify is sending the request, can I not see a log of this somewhere?
My best advice to you is to reach out to your community then. Not sure what scripting language you are using, but it has users that have handled webhooks before, and probably have written blog posts and Stackoverflow stories about your issue. Try them for advice!
As you well know, Webhooks are nothing new or exotic in Internet computing, and Shopify is nothing but standard issue Webhooks. So like all things scripting, I am sure there something in your setup you are missing, and once you find it, you'll have glory!
Thanks for the reply.
Yes, I've built a few systems on webhooks, they truly are magnificent.
I'm using .net/c#.
Do we not have access to logs? I could scout around, but if the logs just tells me the exact problem, I can resolve it. I have a tracer running this end, and nothing is coming in.
My last attempt is to remove the method from the app and add it to a serverless pipeline (Azure HTTP func), if that fails, well I'm truly lost. I recently wrote an app for a WMS system using hooks, with the same process/method and that works fine.
I guess I'll report back.
The puzzle from your Dashboard report is fact none are even reported as being tried. So lets type this out. You install your App, which is all fine and dandy. You mastered oAuth. Your database has a token from a shop (likely your test shop) which you setup in the partner Dashboard with ngrok.io settings directly to your App. I myself use a service allowing me to call me Apps stuff like fizzbuzz.test which map nicely to fizzbuzz.ngrok.io which I setup in my Shopify App dashboard.
Once I am setup, and I navigate to the App and see it come up, usually embedded, and usually Polaris... my Hello World if you will, I then uninstall the App. Shopify fires off the uninstall, I watch my terminal logs where I am running my localhost webserver version of the App, and BOOM. I see the Webhook get processed in real-time.
So simple. But the fact that you are doing ALL that, and seeing nothing, is indeed weird. I cannot speak for C# users, but perhaps someone in that community can get you over the hump.