Webhooks are a way to make changes to your web application through custom callback functions. Webhooks allow you to select the type of notifications you want to receive and receive notifications at a specified URL. Once it's finished requesting the data, the webhook will push the data to you using a POST request via the URL you configured. You will respond as follows after receiving it:{
"code": 0,
"message": "success"
}
The HTTP status code must be 200, otherwise we will treat it as a failure and will push it repeatedly.
1 How to set up webhook#
2 Webhooks re-push mechanism#
If the push fails, I will push it repeatedly according to the following time intervals, a total of 10 times.Number of attempts | Delay before sending (minutes) | Cumulative delay (minutes) |
---|
1 | 0 | 0 |
2 | 3 | 3 |
3 | 6 | 9 |
4 | 9 | 18 |
5 | 12 | 30 |
6 | 15 | 45 |
7 | 18 | 63 |
8 | 21 | 84 |
9 | 24 | 108 |
10 | 27 | 135 |
3 Webhook event type (event_type)#
Event type (event_type) | Description |
---|
review/created | Triggered when a review is created |
review/updated | Triggered when an original review is updated |
review/deleted | Triggered when a comment is deleted or hidden |
4 Pushed data#
{
"Content-Type": "application/json"
"Open-Trustoo-Webhook-Public-token": "1662371528"
"Open-Trustoo-Webhook-Timestamp": "1662371528"
"Open-Trustoo-Webhook-Sign":"a37084ab68ae16b77db1f8463f31be9fcc965e2515e03efecf8139bb1e511b06"
"Open-Trustoo-Webhook-RequestId":"kfhgdsjkfhksdjffkjsghks"
}
Field | Value | Description |
---|
Content-Type | application/json | Requested data format, here is a fixed value |
Open-Trustoo-Webhook-Public-token | xxxx | Authorized Public-token |
Open-Trustoo-Webhook-Timestamp | xxx | Requested Unix timestamp |
Open-Trustoo-Webhook-Sign | xxxx | The requested signature, please refer to the 2.2 sign algorithm in API Quick Start |
Open-Trustoo-Webhook-RequestId | xxxx | Request id |
4.2 Body#
{
"list": [{
"id": 123,
"my_shopify_domain": "example.myshopify.com",
"shopify_shop_id": 456,
"shopify_product_id": 789,
"product_rating": 4,
"is_verified_badge": true,
"reviewer": "John Doe",
"from_country": "USA",
"review_text": "This is a great product!",
"review_images": ["image1.jpg", "image2.jpg"],
"review_videos": ["video1.mp4"],
"review_email": "[email protected]",
"review_phone": "+1234567890",
"create_at": "2023-11-21T12:34:56Z",
"update_at": "2023-11-21T12:45:00Z",
"is_publish": true
}],
"event_type":"review/created"
}
During signature verification, the values in the list are concatenated as a single string for signing.
4.2.1 Body.list#
Field | Value | Description |
---|
id | 123 | A:In the same store, the id is unique (shopify_shop_id+id only) |
shopify_shop_id | 456 | B:shopify’s unique store id |
my_shopify_domain | example.myshopify.com | The shopify domain name of the store |
shopify_product_id | 789 | The unique id of the product |
product_rating | 4 | Product rating 1-5 |
is_verified_badge | true | Whether to verify the badge 1-yes 2-no' |
reviewer | John Doe | Review author |
from_country | USA | From which country |
review_text | This is a great product! | text |
review_images | ["image1.jpg", "image2.jpg"] | Leave a comment on the image |
review_videos | ["video1.mp4"] | Leave a review video |
review_email | [email protected] | Consumer email |
review_phone | +1234567890 | Consumer Phone |
create_at | 2023-11-21T12:34:56Z | Creation time |
update_at | 2023-11-21T12:45:00Z | Update time |
is_publish | 1 | Whether to publish: 1-Publish 2-Unpublish |
4.2.1 Body.event_type#
Please refer to 3 webhook event types (event_type).