Configuration¶
If you already have an Odoo server, restapi and webhook module installed, you can configure your webhooks, one of two ways:
Through the API¶
Odoo requires users to be authenticated before they can register webhook through API.
Note
For more information concerning Odoo authentication, View our REST API Reference guide.
Once the authentication is done through the Odoo OAuth 1.0 restapi/1.0/common/oauth1
or OAuth 2.0 restapi/1.0/common/oauth2
endpoints, The Odoo REST API lets you do the following with the Webhook resource:
- Receive a list of all Webhooks
- Receive a count of all Webhooks
- Receive a single Webhook
- Create a new Webhook
- Modify an existing Webhook
- Remove a Webhook from the database
Note
For more detailed versions of these general actions, View Webhook API Reference guide.
Through your user panel¶
If you are developing an app for a particular company, you can configure your webhooks through your user panel:
Note
- Log in your Odoo instance with your account
- Go to Settings ‣ Technical ‣ Automation ‣ Webhooks ‣ Configuration ‣ Webhooks
- In the Webhooks section, click on Create button
- Enter user friendly
name
of the webhook, Select themodel
for which you want to receive notifications, Select thelanguage
andpayload format
in which you want to receive notifications, Select theevent
you want to listen for from the drop-down box, Select thefields
if you want to receive notifications for those specfic fields only, Give acondition
if you want to recieve notifications only when it specified and enter theCallback URL
(http:// or https://) where you want to receive notifications. - Click on Save button.
After you have created at least one webhook, Odoo lets you test your webhooks to verify that the endpoint is receiving notifications.
In the list of order notifications you will see your webhook. You will also see a “send test notification” link. This “send test notification” link allows you to send an example order to the URL you provided.
If you want to capture the contents of a webhook to examine them, the easiest way is to set up a new subscription with a service like LocalTunnel, RequestBin or PostCatcher (described in Receive a webhook section) which will capture the result and let you view it in a browser.