Get a Webhooks

Note

API endpoints:

Get a list of all webhooks

By default, it will fetch all the webhooks and relavent fields the current user can read. Give an optionally a list of specific fields to fetch.

GET /restapi/1.0/webhooks

Request:

GET /restapi/1.0/webhooks HTTP/1.1
Host: {your_Odoo_server_url}

Response:

HTTP/1.1 200 OK

{
  'webhook': [
      {
          'id': 3,
          'name': 'Product Creation',
          'model': 'product.product',
          'kind': 'on_create',
          'address': 'https://requestbin.net/152eq5l1',
          'format': 'json',
          'language': 'en_US',
          'fields': [],
          'create_date': '2017-11-02 12:15:47',
          'write_date': '2017-11-02 14:12:40'
      },
      {
          '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-02 14:12:40'
      },
      {
          '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-02 14:12:40'
      },
      ...
      ...
      ...
  ]
}
Query Parameters:
 
  • fields – OPTIONAL. list of field names to return (default is all fields).
Request Headers:
 
  • Accept – the response content type depends on Accept header
  • Authorization – The OAuth protocol parameters to authenticate.
Response Headers:
 
Status Codes:

Conversely, picking only six fields deemed interesting.

Request:

GET /restapi/1.0/webhooks?fields=['name','model', 'kind', 'address', 'format', 'language'] HTTP/1.1
Host: {your_Odoo_server_url}

Response:

HTTP/1.1 200 OK

{
  'webhook': [
      {
          'id': 3,
          'name': 'Product Creation',
          'model': 'product.product',
          'kind': 'on_create',
          'address': 'https://requestbin.net/152eq5l1',
          'format': 'json',
          'language': 'en_US',
      },
  ...
  ...
  ...
  ]
}

Note

even if the id field is not requested, it is always returned

Get a single webhook by its id

Give a single webhook id and optionally a list of fields to fetch. By default, it will fetch all the fields the current user can read.

GET /restapi/1.0/webhooks/{id}

Request:

GET /restapi/1.0/webhooks/7 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-02 14:12:40'
  }
}
Query Parameters:
 
  • fields – OPTIONAL. list of field names to return (default is all fields).
Request Headers:
 
  • Accept – the response content type depends on Accept header
  • Authorization – The OAuth protocol parameters to authenticate.
Response Headers:
 
Status Codes:

Conversely, picking only six fields deemed interesting.

Request:

GET /restapi/1.0/webhooks/7?fields=['name','model', 'kind', 'address', 'format', 'language'] 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'
  }
}

Note

even if the id field is not requested, it is always returned

Get a list of webhooks of particular ids

Give a list of webhook ids and optionally domain filter and a list of fields to fetch. By default, it will fetch all the fields the current user can read.

GET /restapi/1.0/webhooks?ids={comma_separated_ids}

Request:

GET /restapi/1.0/webhooks?ids=3,12 HTTP/1.1
Host: {your_Odoo_server_url}

Response:

HTTP/1.1 200 OK

{
  'webhook': [
      {
          'id': 3,
          'name': 'Product Creation',
          'model': 'product.product',
          'kind': 'on_create',
          'address': 'https://requestbin.net/152eq5l1',
          'format': 'json',
          'language': 'en_US',
          'fields': [],
          'create_date': '2017-11-02 12:15:47',
          'write_date': '2017-11-02 14:12:40'
      },
      {
          '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-02 14:12:40'
      }
  ]
}
Query Parameters:
 
  • fields – OPTIONAL. list of field names to return (default is all fields).
Request Headers:
 
  • Accept – the response content type depends on Accept header
  • Authorization – The OAuth protocol parameters to authenticate.
Response Headers:
 
Status Codes:

Conversely, picking only six fields deemed interesting.

Request:

GET /restapi/1.0/webhooks?ids=3,12&fields=['name', 'model', 'kind', 'address', 'format', 'language'] HTTP/1.1
Host: {your_Odoo_server_url}

Response:

HTTP/1.1 200 OK

{
  'webhook': [
      {
          'id': 3,
          'name': 'Product Creation',
          'model': 'product.product',
          'kind': 'on_create',
          'address': 'https://requestbin.net/152eq5l1',
          'format': 'json',
          'language': 'en_US'
      },
      {
          'id': 12,
          'name': 'Product Deletion',
          'model': 'product.product',
          'kind': 'on_unlink',
          'address': 'https://requestbin.net/152eq5l1',
          'format': 'json',
          'language': 'en_US'
      }
  ]
}

Note

even if the id field is not requested, it is always returned

Get a list of specific webhooks using domain filter

Give a Domain filter and optionally a list of fields to fetch. By default, it will fetch all the webhooks and relavent fields the current user can read.

GET /restapi/1.0/webhooks/?domain={comma_separated_list_of_args}

Request:

GET /restapi/1.0/webhooks?domain=[('model','=','product.product'),('kind','=','on_write')] 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-02 14:12:40'
      }
  ]
}
Query Parameters:
 
  • domain – OPTIONAL. A search domain. Use an empty list to match all webhooks.
  • fields – OPTIONAL. list of field names to return (default is all fields).
  • offset – OPTIONAL. Number of results to ignore (default: none)
  • limit – OPTIONAL. Maximum number of webhooks to return (default: all)
  • order – OPTIONAL. Sort string
  • count – OPTIONAL. if True, only counts and returns the number of matching webhooks (default: False)
Request Headers:
 
  • Accept – the response content type depends on Accept header
  • Authorization – The OAuth protocol parameters to authenticate.
Response Headers:
 
Status Codes:

Conversely, picking only six fields deemed interesting.

Request:

GET /restapi/1.0/webhooks?domain=[('model','=','product.product'),('kind','=','on_write')]&fields=['name', 'model', 'kind', 'address', 'format', 'language']&limit=5 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'
      }
  ]
}

Note

even if the id field is not requested, it is always returned