What are the best practices for an optimal integration?
Processing reviews with webhooks
- From your account dashboard, go to API settings and add your backend IP address to the table of IP whitelisting.
- Add your HTTP webhook endpoint.
- Make sure to enable all events. Set “Payload” option to Only changes. Keep frequency set to Right away.
- The first call is very unlikely to include reviews. In the event it does, which can happen when the subscription has been set to idle for some time, make sure to insert them in your DB.
You can send sample calls to your webhook from the API settings page.
- Make sure to set autoRenew to true. This will help you save ~⅓ of the cost of the future cycles.
- When requesting reviews from a page for the first time, make sure to include your page’s internalId. This will help identify the page when receiving calls from our servers.
- Security:
- Configure your webhook to only accept calls from our backend server IP address 18.220.82.182
- Check for your API token in the header X-Zembra-Token and confirm the user agent is Zembra-Agent
- When your endpoint receives a POST request from us, you will find:
- The internalId along with details about the description can be found under field subscription.
- The updated details about the target.
- Under updates field you will find 5 array fields: newReviews, editedReviews, newReplies, deletedReviews, restoredReviews.
- editedReviews and newReplies may and may not include reviews seen also under newReviews.
- Rely on the review id, reply id, author id, etc to take adequate CRUD actions.
No need to schedule cron jobs or perform long polling.
Upon any changes detected, similar payload will be delivered.
Cancel the subscription if you do not want it to be renewed - it will continue to run until the end of the subscription.
Other recommendations
- Use the API sandbox when building the integration
- We offer SDKs for 12 programming languages
- Test your webhook from your account
- Stay consistent with your slugs. Preferably use the version returned by the API.
Recommended webhook configuration
Backend-to-Backend Communication
If we don’t receive 200 feedback after 5 retries, we permanently mark it as failed delivery and we notify the admin by email.