Development discussions around Shopify APIs
I know webhooks are inherently unreliable and the docs recommend not depending on them fully. So my question is how can we reliably determine if an app is uninstalled in the case when no "uninstall" webhook was called?
We currently have several cases where the user uninstalled but due to error in processing of webhooks our app doesn't know and continuously bangs into 401 trying to do normal every day processing.
One approach would be to send a "ping" request, for exame to get shop,json at interval and then look at the return;
2xx = all good
401 = user uninstalled
4xx = api version mismatch?
5xx / timeout /whatever else = wait for a while and try again
This seems kind of hackis, so is there an endpoint that would let us know the status of a store vs. our app?
Hi,
The webhook should be reliable however if you're having issues on your end processing the webhook itself, then that won't be useful for you. It's best to try and resolve the issues you're having with processing the webhooks sent. However, as another method, I believe you should be able to call the API to get the shop (as you mentioned) using the token for that shop. If that call doesn't work due to an issue with the token, that would indicate that you no longer have permission because the shop has uninstalled your app.
Cheers,
Mike
mikedasilva | Developer @ 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
User | RANK |
---|---|
6 | |
5 | |
5 | |
5 | |
4 |
Learn these 5 things I had to learn the hard way with starting and running my own business
By Kitana Jan 27, 2023Would you love to unleash the unbridled power of the Google Shopping Channel into your sho...
By Gabe Jan 6, 2023How can you turn a hobby into a career? That’s what Emmanuel did while working as a wa...
By Skye Dec 30, 2022