Use hooks to be notified about events that happen in Lipscore like a new Rating or a Review. You can register hook URLs that we will notify any time an event happens in Lipscore. We will send all the relevant information about what just happened, via an HTTP POST request, to any endpoint URLs that you have defined during the hook registration.


POST /hooks
Register a Hook

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.

Supported Formats

json

Params

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

Examples

POST /hooks?api_key=889c3f3e4b6ac67269261324

Request
{ "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": [ "Lipscore_4716051", "Lipscore_4716051_Black" ], "brand": "Lipscore", "id": "1807875", "internal_id": "4716051", "name": "Lipscore Ultra i9 SmartPhone", "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": [ "Lipscore_4716051", "Lipscore_4716051_Black" ], "brand": "Lipscore", "id": "1807875", "internal_id": "4716051", "name": "Lipscore Ultra i9 SmartPhone", "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": [ "Lipscore_4716051", "Lipscore_4716051_Black" ], "brand": "Lipscore", "id": "1807875", "internal_id": "4716051", "name": "Lipscore Ultra i9 SmartPhone", "gtin": "3234567890126" }, "origin": { } }

DELETE /hooks/:id
Destroy a Hook and cancel a subscription.

Send an HTTP DELETE request to destroy Hook and cancel a subscription. Use Hook ID, provided by Lipscore during Hook registration, to identify a Hook you want to destroy. On a successful cancellation we will return a 200 status code.

Supported Formats

json

Params

Param name Description
id
required

Hook ID provided by Lipscore


Value:

Must be a Integer

api_key
required

API key (a 24 character unique code)


Value:

Must be a String

Examples

DELETE /hooks/1?api_key=889c3f3e4b6ac67269261324

Request
{ "id": 1 }
Response
{ }