Repository
OCA/web-api · module folder · Try on Runboat
Module version
1.2.0
Category
Uncategorized
Folder size
0.14 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/web-api
Last tracking update
2026-08-11 17:30:52
Authors
Camptocamp, Odoo Community Association (OCA), Creu Blanca
Maintainers
Camptocamp, Odoo Community Association (OCA), Creu Blanca
Committers
Ricardoalso, Iván Todorovich, Maksym Yankin, Weblate, OCA-git-bot, oca-ci
Odoo dependencies
OCA/connector:
odoo/odoo:
Python dependencies
oauthlib, requests-oauthlib, responses, cachetools
System dependencies
None
Required by
edi_webservice_oca, webservice_server_env
Description
This module creates WebService frameworks to be used globally.

The module introduces support for HTTP Request protocol. The webservice HTTP call returns by default the content of the response. A context 'content_only' can be passed to get the full response object.

Code Analysis

Views touched (3)
XML IDNameModelTypeStatus
webservice_backend_form_view webservice.backend.form (in webservice) webservice.backend form New
webservice_backend_search_view webservice.backend.search (in webservice) webservice.backend search New
webservice_backend_tree_view webservice.backend.tree (in webservice) webservice.backend list New
HTTP endpoints (1)
Route(s)HandlerAuthTypeMethodsFlags
/webservice/<int:backend_id>/oauth2/redirect OAuth2Controller.redirect public http ALL csrf off sudo
Models touched (1)

New fields (25)
  • api_key Char
    auth_type='api_key' string='API Key'
  • api_key_header Char
    auth_type='api_key' string='API Key header'
  • auth_type Selection
    required=True selection=[('none', 'Public'), ('user_pwd', 'Username & password'), ('api_key', 'API Key'), ('oauth2', 'OAuth2')]
  • company_id Many2one → res.company
    string='Company' args: 'res.company'
  • content_type Selection
    args: [('application/json', 'JSON'), ('application/xml', 'XML'), ('application/x-www-form-urlencoded', 'Form')]
  • name Char
    required=True
  • oauth2_audience Char
    string='Audience'
  • oauth2_authorization_url Char
    string='Authorization URL'
  • oauth2_client_auth_header Char
    default='Authorization' help='Header name used to send the client credentials when the client authentication method is a custom Authorization header.' string='Client Auth Header'
  • oauth2_client_auth_method Selection
    default='client_secret_basic' help='How the client credentials are presented to the token endpoint.' string='Client Authentication' args: [('client_secret_basic', 'Client ID & Secret (HTTP Basic)'), ('custom_header', 'Custom Authorization header')]
  • oauth2_client_auth_value Char
    help="Full, static header value sent to the token endpoint when the client authentication method is a custom Authorization header (e.g. 'SSWS <token>')." string='Client Auth Header Value'
  • oauth2_client_secret Char
    string='Client Secret'
  • oauth2_clientid Char
    string='Client ID'
  • oauth2_flow Selection
    readonly=False args: [('backend_application', 'Backend Application (Client Credentials Grant)'), ('web_application', 'Web Application (Authorization Code Grant)')]
  • oauth2_scope Char
    help='scope of the the authorization'
  • oauth2_state Char
    help='random key generated when authorization flow starts to ensure that no CSRF attack happen'
  • oauth2_token Char
    help='the OAuth2 token (serialized JSON)'
  • oauth2_token_method Selection
    default='post' help='HTTP method used to request the token from the token endpoint. Most providers use POST; some expose the token endpoint as GET.' string='Token Request Method' args: [('post', 'POST'), ('get', 'GET')]
  • oauth2_token_url Char
    auth_type='oauth2' string='Token URL'
  • password Char
    auth_type='user_pwd'
  • protocol Selection
    required=True args: [('http', 'HTTP Request')]
  • redirect_url Char
    compute='_compute_redirect_url' help='The redirect URL to be used as part of the OAuth2 authorisation flow'
  • tech_name Char
    required=True
  • url Char
    required=True
  • username Char
    auth_type='user_pwd'
Public methods (2)
  • button_authorize(self)
  • call(self, method, *args, **kwargs)

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…