Emplifi Ratings & Reviews Webhooks
Webhooks let you get data from Emplifi Ratings & Reviews when events happen. Webhooks are HTTP callbacks that send real-time data in JSON format. They replace once-daily feed processing with updates that are automatically triggered when content is added or changed. Webhooks can directly integrate with your product information management (PIM) software, ecommerce platforms, or help desk systems.
Webhooks vs. APIs
Why use a webhook when an API endpoint can provide the same data? An API does something when you ask it to. A webhook does something when an event happens. With API calls, you start the communication. With a webhook, Emplifi starts the communication. It's like the difference between checking your mailbox each day to see if you have received a package (API) versus getting an alert when a postal worker delivers a package (webhook).
Parts of a webhook implementation
Emplifi has developed webhooks for the "review" entity type.
An event type is a category of actions in the Emplifi system that generates data for an entity. An event is an action.
Event example: A review is published.
A webhook URL (endpoint), is a client-provided, secure destination that accepts HTTP post requests. This is where a Emplifi webhook will send event information.
A subscription is the mechanism that associates Emplifi events with your webhook URL.
You subscribe to events, and Emplifi sends data for that event type to the webhook URL as the events occur.
A webhook payload is a JSON blob delivered to the webhook URL.
Getting started with webhooks
Decide your security and privacy strategies.
Depending on your security strategy, you may need your Emplifi siteKey, authKey, and bearer token.
See Security and privacy for supported options.
Determine your webhook URL, where Emplifi should deliver the webhook payload.
Work with Emplifi Support to define which events to include in your subscription.
Set up your webhook URL (endpoint) to receive event notifications (JSON Messages) with your security strategy.
Work with Emplifi Support to:
Configure a webhook subscription for your test site
Test and verify the endpoint using your test site
Configure a webhook subscription for your production site
Test and verify the endpoint in production
Security and privacy
Privacy
Emplifi can remove personally identifiable information (PII) before sending data to your webhook URL.
Available PII policies include:
ALLOW_ALL - all PII is included in webhook events
HIDE_EMAIL - email addresses are hidden in webhook events
HIDE_ALL - no PII is included in webhook events
Security
Emplifi provides multiple authentication methods to support your security strategy as you set up a webhook URL (endpoint) where you will receive event notifications.
Available authentication strategies include:
NONE - no authorization method included
HTTP BASIC - payload includes HTTP basic authorization header (you provide a user name and password that we'll use to access your URL)
REQUEST SIGNING - a webhook request includes a signature parameter to verify that the sender is Emplifi, by hashing expected values associated with the call. This strategy can be combined with any of the other strategies
BEARER - payload includes site-specific OAuth 2.0 Bearer token authorization header
Request Signing Hash
With the REQUEST SIGNING authentication method, the query string of a webhook request includes a ttsign
parameter. This field's value is a URL-encoded HMAC SHA256 hash of a combination of information from the webhook body and your webhook signed with your authkey. You can compute this value yourself to verify the request's authenticity.
The pre-hashed string is an ampersand-separated string. It includes the following fields in the listed order:
Webhook endpoint URL - the full webhook URL (endpoint) you provided Emplifi
Review Title - the title of the review in the payload, found in the
title
field of the entity in the request payloadReview Text - the review text from the
text
field of the entity in the request payloadRating - the value from the
rating
field of the entity in the request payloadRequest Timestamp - the timestamp of the request, found in the
webhookTimestamp
field of the request payload
The example payload below, with a hypothetical webhook-receiving endpoint of https://www.example.com/turnto_webhooks
, results in the pre-hashed string:
https://www.example.com/turnto_webhooks&An awesome jacket!&This jacket fits perfectly and looks absolutely amazing.&4&1581368301529
To verify the request's authenticity:
Hash the string with an HMAC SHA256 hash, using your Emplifi site's authkey as the private key.
Base-64 encode the hash.
Compare the result to the
ttsign
parameter.
Event types in Emplifi webhooks
Event Type | Triggered When |
---|---|
CREATE | A review has been submitted. |
PUBLISH | A review has been approved for public display. |
HIDE | A review has been hidden. |
DELETE | A review has been deleted. |
VOTES | The total number of upvotes or downvotes on a review has changed. |
TAG | Tags on a review have changed. |
CS_FLAG_ON | A review has been flagged for Customer Service action. |
CS_FLAG_OFF | The CS Flag has been removed from a review. |
RESPONSE | A review response has been published, hidden or deleted. |
MEDIA_PUBLISH | A picture or video submitted with a review has been approved for public display. |
MEDIA_HIDE | A picture or video submitted with a review has been hidden. |
Webhook payload data fields
Name | Description |
---|---|
entity | The entity includes the review id, content, and details. |
entityType | The type of content in the entity, e.g. 'review'. |
eventType | The category of the event. (See Event types in Emplifi webhooks, above) |
affectedKey | The affectedKey identifies the entity type that triggered the webhook. For the entity, the affectedKey is "top". For a nested entity, it is formatted Example: If your subscription includes published response events, the affectedKey woud be |
siteKey | This is the site key from your site’s Emplifi configuration page. |
siteDisplayName | This is the display name from your site's Emplifi configuration page. |
webhookTimestamp | This is the time when the event was converted to a webhook call. |
webhookRequestId | The webhookRequestId is made up of:
(Where the attempt number is 0 on the initial call, 1 on the first call, etc.) |
webhookVersion | This shows the schema version of the JSON payload. |
Example webhook payload
If you have a webhook endpoint with a different payload schema, contact Emplifi Support to discuss payload customization. Advanced customization may incur additional costs and an extended timeline for testing and deployment.
Retry behavior
If a webhook fails, the failure is logged. The call will be retried twice: first after 5 seconds and again after 15 seconds.