Webhook
Overview
The LORA API allows customers to leverage real-time subscriptions to events on models in the LORA system.
When an event is detected on a model belonging to an organization with a webhook binding, that change is forwarded to your API.
Webhooks are delivered to a predetermined callback URL using the GET/POST method. The URL is expected to be provided by the client.
Collections
Collection name | Supported Actions | Method | Description |
show | ShowCreated | GET/POST | Applicable to all creating show with in an organization |
product | TBC | TBC | TBC |
Common data model
{
Action, // see appendix for the list of values
Category, // see appendix for the list of values
Timestamp, // a Datetime with timezone at the time of webhook is triggered by LORA
Payload, // the detail datamodel that LORA send out via webhook - ref appendix for detail
}
Depending on the Action & Category, the Payload will be changed accordingly to the right business model.
Show
ShowCreated
Pre-requisite: The admin must be registered to the event via LORA CMS
Event Description: triggered when a LIVE show is set up and created successfully.
Sample output
Assume that admin registered on CMS with the webhook url as following:
https://mywebhook.com/hook/showcallback
For GET method
Data will be sent out by
Request url:
https://mywebhook.com/hook/showcallback?action=ShowCreated&category=Show.ShowCreated&payload=[serialized-as-json]×tamp=[datetime with timezone]
For POST method
Data will be sent out by
Request url:
https://mywebhook.com/hook/showcallback
Payload: follow the common data model
Appendix
Definition for Category
Name | Description | Note |
Show.ShowCreated | Show is created | Available in LORA version 4.0 |
Definition for Action
Name | Description | Note |
ShowCreated | Show is created | Available in LORA version 4.0 |
Payload model for ShowCreated
Field | Data type | Description | Version |
showId | string | Id of the show | 4.0 |
title | string | Title of the show | 4.0 |
hostId | number | User id of host | 4.0 |
themeId | number | The id of selected theme | 4.0 |
productIds | string[] | The array of all selected product Ids in the show. Ex: [“1”, “2”] | 4.0 |
shareLink | string | Title of the show | 4.0 |
coverImageFileUrl | string | Title of the show | 4.0 |
placeHolderImageFileUrl | string | Title of the show | 4.0 |
isObs | boolean | Title of the show | 4.0 |
vouchers | object[] | The list of vouchers that is added to the show See Voucher model for more detail | 4.0 |
Voucher data model
Field | Data type | Description | Version |
code | string | Code of voucher | 4.0 |
description | string | Description of voucher | 4.0 |
discount | number | Amount to be discount | 4.0 |