Update an existing Webhook¶
Note
API endpoints:
- PUT {your_Odoo_server_url}/restapi/1.0/webhooks/{id}?vals={fields_and_values_to_update} (Update a single webhook by its id)
- PUT {your_Odoo_server_url}/restapi/1.0/webhooks?ids={comma_separated_ids}&vals={fields_and_values_to_update} (Update a list of webhooks of particular ids)
Update a single webhook by its id¶
Give a single webhook id and a mapping of updated fields to values.
-
PUT
/restapi/1.0/webhooks/{id}?vals={fields_and_values_to_update}
¶ Request:
PUT /restapi/1.0/webhooks/7?vals={'address':'https://requestbin.net/152eq5l1'} HTTP/1.1 Host: {your_Odoo_server_url}
Response:
HTTP/1.1 200 OK { 'webhook': { 'id': 7, 'name': 'Product Update', 'model': 'product.product', 'kind': 'on_write', 'address': 'https://requestbin.net/152eq5l1', 'format': 'json', 'language': 'en_US', 'fields': [], 'create_date': '2017-11-02 12:15:47', 'write_date': '2017-11-29 11:10:14' } }
Query Parameters: - vals – fields to update and the value to set on them::
{'field_name': field_value, ...}
see write() for details.
Request Headers: - Accept – the response content type depends on Accept header
- Authorization – The OAuth protocol parameters to authenticate.
Response Headers: - Content-Type – this depends on Accept header of request
Status Codes: - 200 OK – no error
- 404 Not Found – there’s no resource
- 401 Unauthorized – authentication failed
- 403 Forbidden – if any error raise
- vals – fields to update and the value to set on them::
Update a list of webhooks of particular ids¶
Give a list of webhook ids and a mapping of updated fields to values.
Warning
Multiple webhooks can be updated simultanously, but they will all get the same values for the fields being set. It is not currently possible to perform computed updates (where the value being set depends on an existing value of a webhook).
-
PUT
/restapi/1.0/webhooks?ids={comma_separated_ids}&vals={fields_and_values_to_update}
¶ Request:
PUT /restapi/1.0/webhooks?ids=7,12&vals={'address':'https://requestbin.net/152eq5l1'} HTTP/1.1 Host: {your_Odoo_server_url}
Response:
HTTP/1.1 200 OK { 'webhook': [ { 'id': 7, 'name': 'Product Update', 'model': 'product.product', 'kind': 'on_write', 'address': 'https://requestbin.net/152eq5l1', 'format': 'json', 'language': 'en_US', 'fields': [], 'create_date': '2017-11-02 12:15:47', 'write_date': '2017-11-29 11:10:14' }, { 'id': 12, 'name': 'Product Deletion', 'model': 'product.product', 'kind': 'on_unlink', 'address': 'https://requestbin.net/152eq5l1', 'format': 'json', 'language': 'en_US', 'fields': [], 'create_date': '2017-11-02 12:15:47', 'write_date': '2017-11-29 11:10:14' } ] }
Query Parameters: - vals –
fields to update and the value to set on them::
{'field_name': field_value, ...}
see write() for details.
Request Headers: - Accept – the response content type depends on Accept header
- Authorization – The OAuth protocol parameters to authenticate.
Response Headers: - Content-Type – this depends on Accept header of request
Status Codes: - 200 OK – no error
- 404 Not Found – there’s no resource
- 401 Unauthorized – authentication failed
- 403 Forbidden – if any error raise
- vals –