This is an old revision of the document!
Webhooks
Gives Webhook functionality to Lime CRM. Webhooks make it possible to create a subscription from an external system to events in Lime CRM. You can subscribe to new
, update
, delete
and restore
for all available Limetypes.
Features
It is possible to list available events, current subscriptions and register a new or update an existing subscription.
Authorization
To be able to call the endpoints, the user must be an Administrator or part of the dedicated Lime CRM group Webhook Users
.
Requirements
- On-premise server environment.
- Lime CRM server version 12.48 or newer.
Install
- Create a group in LISA called
Webhook Users
. - Download the latest release from GitHub (Internal access only). Unzip and put it in a folder for plugins on the application server. Please note that the files will be used also when running it, and not just for installation.
- In a command prompt with elevated rights, go to the folder where you put the files and run the following command.
Lime crm server < 13:
limeplug install .
Lime crm server >= 13:
pip install -e .
- Restart the web server and the event handler
Endpoints
The base url is https://{your_lime_app_url}/{your_lime_app}/api/v1/subscription/
List available events/subscriptions
GET: /subscription/available/
List current subscriptions
GET: /subscription/
Create a subscription
POST: /subscription/
One can add a secret key when creating a subscription.
request body:
{ "events" : ["company.new", "helpdesk.update"], "target_url" : "https://example.org/hook/123", "secret": "very_secret_key" // optional }
Update a subscription
Partial updates are supported, i.e just updating one, or more properties without affecting the remaining properties
PUT: /subscription/:id
request body:
{ "events" : ["company.new"], "target_url" : "https://example.org/hook/123", "enabled": true }
Show a subscription
GET: /subscription/:id
response body:
{ "id" : 1, "events" : ["company.new"], "target_url" : "https://example.org/hook/123", "enabled": true }
Delete a subscription
DELETE: /subscription/:id