Register hook URLs that we will notify any time an event happens in Lipscore. Send unique hook endpoint URL and the event you’d like to subscribe to. On a successful hook registration we will return a 200 status code.
Param name | Description |
---|---|
event required |
Event you want to be notified. Possible values are rating_created, review_created, question_created. Value: Must be a String |
target_url required |
Hook endpoint on your server that will receive event data. The event data is sent as JSON in the POST request body. The URL should be unique otherwise we will return a 409 Conflict status code. Value: Must be a String |
api_key required |
API key (a 24 character unique code) Value: Must be a String |
POST /hooks?api_key=889c3f3e4b6ac67269261324Request
{ "event": "rating_created", "target_url": "http://mysite.com/hooks/78" }Response
{ "id": 1 }Rating created event data
{ "lang": "en", "rating": 5, "created_at": "2022-09-29T09:25:14.558Z", "updated_at": "2022-09-29T09:25:14.558Z", "id": 1528, "product": { "sku": [ "LipscoreDemo_4716051", "LipscoreDemo_4716051_Gold" ], "brand": "HTC", "id": "1807875", "internal_id": "4716051", "name": "LipscoreDemo HTC One M8", "gtin": "3234567890126" }, "user": { "id": 56634, "name": "John Doe", "avatar_thumb_url": "https://static.lipscore.com/avatars/000/000/000/thumb_000000005936.jpg", "short_name": "John" }, "review": { "lang": "en", "status": "new", "review_reply": { "text": "Thank you!", "created_at": "2022-12-25T07:06:34.362Z", "member_site": "Demo site" }, "testimonial": true, "text": "This product is great! I will be back for more, thank you!", "created_at": "2022-09-29T09:28:47.091Z", "updated_at": "2022-09-29T09:28:47.181Z", "images": [ { "id": 134, "thumb_url": "https://static.lipscore.com/uploads/000/000/000/thumb_000000000134.jpg", "image_url": "https://static.lipscore.com/uploads/000/000/000/000000000134.jpg" } ], "flag": "media_content", "video": "", "purchase_date": "2022-08-20T17:20:05.21Z", "votes_down": 0, "votes_up": 0, "id": 1272 } }Review created event data
{ "lang": "en", "status": "new", "review_reply": { "text": "Thank you!", "created_at": "2022-12-25T07:06:34.362Z", "member_site": "Demo site" }, "testimonial": true, "text": "This product is great! I will be back for more, thank you!", "created_at": "2022-09-29T09:28:47.091Z", "updated_at": "2022-09-29T09:28:47.181Z", "images": [ { "id": 134, "thumb_url": "https://static.lipscore.com/uploads/000/000/000/thumb_000000000134.jpg", "image_url": "https://static.lipscore.com/uploads/000/000/000/000000000134.jpg" } ], "flag": "media_content", "video": "", "purchase_date": "2022-08-20T17:20:05.21Z", "votes_down": 0, "votes_up": 0, "id": 1272, "product": { "sku": [ "LipscoreDemo_4716051", "LipscoreDemo_4716051_Gold" ], "brand": "HTC", "id": "1807875", "internal_id": "4716051", "name": "LipscoreDemo HTC One M8", "gtin": "3234567890126" }, "rating": { "lang": "en", "rating": 5, "created_at": "2022-09-29T09:25:14.558Z", "updated_at": "2022-09-29T09:25:14.558Z", "id": 1528 }, "user": { "id": 56634, "name": "John Doe", "avatar_thumb_url": "https://static.lipscore.com/avatars/000/000/000/thumb_000000005936.jpg", "short_name": "John" } }Question created event data
{ "id": "39_216", "text": "Does it have a wi-fi module?", "created_at": "2022-10-01T09:54:37Z", "status": "new", "published": true, "lang": "en", "answer": null, "user": { "id": 56634, "name": "John Doe", "avatar_thumb_url": "https://static.lipscore.com/avatars/000/000/000/thumb_000000005936.jpg", "short_name": "John" }, "product": { "sku": [ "LipscoreDemo_4716051", "LipscoreDemo_4716051_Gold" ], "brand": "HTC", "id": "1807875", "internal_id": "4716051", "name": "LipscoreDemo HTC One M8", "gtin": "3234567890126" }, "origin": { } }