- Subscribe to RSS Feed
- Mark Thread as New
- Mark Thread as Read
- Float this Thread for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
This topic can include other discussion and inquiries about the Weebly Webhooks for Site Events, but I received a question from a developer today and wanted to share it and the answer here for our developers.
Question
How can I be certain that my app is only installed by customers whose sites have the appropriate plan features available?
Answer
The best practice recommended approach is for developers to leverage the `access_token` they receive as part of the Application Installation and Authorization Flow, and to make a request to the Site API and inspect the `plan` property value that is returned in the response. The developer should include business logic as part of the code to properly reject customers who do not meet minimum plan requirements, and to only approve those who do by sending the final destination callback request to Weebly. This final step is required for all apps. When Weebly receives this request, we accept that as developer's giving us the "green light" to install the application to the customer's site.
During the course of our discussion, the developer said, that's a great solution during the installation process, but how am I expected to know when a customer has downgraded their site which could put my app instance in a failure state on their site and increase my support cases?
I suggested the developer include a webhook subscription as part of their app which is set to receive the `site.update` events from Weebly. These events are broadcast any time a site is updated and include the `site_id`, using this piece of data, developers can repurpose the Site API request and business logic to determine if they still meet the minimum requirements of their app. If not, developers should contact the customer (perhaps using an automated notification system) about how the customer's change to the plan for their site impacts app operability, and may require the developer to deauthorize their site's usage of the app if they don't resolve the issue in a reasonable amount of time.
I'm curious what Weebly Developers think about this approach:
- Can it be improved?
- Does it have any drawbacks?
What other uses of Site Event Webhooks do you employ in your applications? I'd love to hear them!
If you're not familiar with Weebly Webhooks or how to create a webhook consumer, take a look at our Node.js Weebly Webhook Client on Github. Developers can use this as a referene/resource to test learning how to build and use Weebly Webhooks in their applications.
- Labels:
-
app
-
App Center
-
CUSTOMERS
-
plans
-
site
-
site.update
-
webhooks
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report