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.


Value:

Must be 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 String

api_key
required

API key (a 24 character unique code)


Value:

Must be 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": "2017-09-29T09:25:14.558Z", "updated_at": "2017-09-29T09:25:14.558Z", "id": 1528, "product": { "sku": [ "LipscoreDemo_4716051" ], "brand": "HTC", "id": "1807875", "internal_id": "4716051", "name": "LipscoreDemo HTC One M8 Gold" }, "user": { "id": 56634, "name": "John Doe", "avatar_thumb_url": "https://static.lipscore.com/avatars/000/000/000/thumb_000000005936.jpg" }, "review": { "lang": "en", "status": "new", "review_reply": { "text": "Thank you!", "created_at": "2017-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": "2017-09-29T09:28:47.091Z", "updated_at": "2017-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": "2017-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": "2017-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": "2017-09-29T09:28:47.091Z", "updated_at": "2017-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": "2017-08-20T17:20:05.21Z", "votes_down": 0, "votes_up": 0, "id": 1272, "product": { "sku": [ "LipscoreDemo_4716051" ], "brand": "HTC", "id": "1807875", "internal_id": "4716051", "name": "LipscoreDemo HTC One M8 Gold" }, "rating": { "lang": "en", "rating": 5, "created_at": "2017-09-29T09:25:14.558Z", "updated_at": "2017-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" } }