Use Hooks to be notified about events that happen in Lipscore like a new Rating, Review or Question. You can register the Hook URLs that we will notify on any time the event happens in Lipscore. We will send all the relevant information about the event via an HTTP POST request, to any endpoint URLs that you have defined during the Hook registration.
We use additional level of security for Hooks: HMAC signatures. Each event send from Lipscore includes the Lipscore-HMAC-SHA256-Base64 header which you can decode and validate to verify the data integrity, replay protection & authenticity of the event. HMAC signature header is calculated with SHA256 hash function, your account’s HMAC secret & the raw request body. It is encoded with Base64 RFC 4648 schema. You can find your HMAC secret in the API settings of your account.
If the event response from your system is not successful, we will retry the event request for 24 hours with an exponential backoff between each attempt. If you wish to delete & unsubscribe from the Hook: you can either use DELETE endpoint or respond with a 410 status code.
Receive the list of all registered Hooks in your account.
On the successful request we will return a 200 status code.
Param name | Description |
---|---|
api_key required |
API key (a 24 character unique code) Value: Must be a String |
GET /hooks?api_key=889c3f3e4b6ac67269261324Response
[ { "id": 1, "event": "rating_created", "target_url": "http://mysite.com/hooks/78" } ]
Register the Hook URLs that we will notify any time the provided event happens in Lipscore. Provide the unique Hook endpoint URL and the event you’d like to subscribe to.
On the successful Hook registration we will return a 200 status code, if the provided Hook already exists we will return a 409 status code.
Param name | Description |
---|---|
event required |
Event you want to be notified on. Available 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
{ "event_type": "rating", "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", "mpn": "XTR-4590A" }, "user": { "id": 56634, "name": "John Doe", "avatar_thumb_url": "https://static.lipscore.com/avatars/000/000/000/thumb_000000005936.jpg", "email": "johndoe@example.com", "internal_customer_id": "84021" }, "review": { "event_type": "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 }, "invitation": { "source_id": "storo1", "source_name": "Storo Shopping Center", "parent_source_id": "south", "parent_source_name": "South" } }Review created event data
{ "event_type": "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, "product": { "sku": [ "Lipscore_4716051", "Lipscore_4716051_Black" ], "brand": "Lipscore", "id": "1807875", "internal_id": "4716051", "name": "Lipscore Ultra i9 SmartPhone", "gtin": "3234567890126", "mpn": "XTR-4590A" }, "rating": { "event_type": "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", "email": "johndoe@example.com", "internal_customer_id": "84021" }, "invitation": { "source_id": "storo1", "source_name": "Storo Shopping Center", "parent_source_id": "south", "parent_source_name": "South" } }Question created event data
{ "id": "39_216", "event_type": "question", "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", "email": "johndoe@example.com" }, "product": { "sku": [ "Lipscore_4716051", "Lipscore_4716051_Black" ], "brand": "Lipscore", "id": "1807875", "internal_id": "4716051", "name": "Lipscore Ultra i9 SmartPhone", "gtin": "3234567890126", "mpn": "XTR-4590A" }, "origin": {} }
Send the HTTP DELETE request to delete the Hook and cancel the subscription. Use Hook ID, provided by Lipscore during the Hook registration, to identify the Hook you want to delete.
On the successful deletion we will return a 200 status code, if the provided Hook ID is invalid we will return a 404 status code.
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 |
DELETE /hooks/1?api_key=889c3f3e4b6ac67269261324Request
{ "id": 1 }Response
{}