Please install all the python dependencies described in the requirements.txt file
Install this module in a usual way
Add
openapito--loadparameters, e.g.:./odoo --workers=2 --load openapi,web --config=/path/to/openerp-server.conf
TODO
* Activate Developer Mode
* Open the developer tools drop down
* Click menu Configure REST API located within the dropdown
* On the form that opens, activate and configure this module for REST API accessability.
* Click [Apply]
- Open menu
[[ Settings ]] >> Dashboard - In REST API section click
[Add Integration]- Specify Name for integration, e.g.
test - Set Log responses Full
- Click
[Save]
- Specify Name for integration, e.g.
- Click smart-button
Accessable models - Click
[Create]- Set Model, for example res.users
- Configure allowed operations
- [x] Create via API
- Set Creation Context Presets, for example
- Name:
brussels - Context:
{'default_tz':'Europe/Brussels', 'default_lang':'fr_BE'}
- Name:
- Set Creation Context Presets, for example
- [x] Read via API
- Set Read One Fields -- fields to return on reading one record
- Set Read Many Fields -- fields to return on reading multiple records
- [x] Update via API
- [x] Delete via API
- [x] Create via API
- Open menu
[[ Settings ]] >> Users >> Users - Select a user that will be used for iteracting over API
- In
REST APItab:- Set Allowed Integration
- In
REST APItab Click[Generate Access Token] - Copy Basic Authentication code to use in any system that support REST API (Open API)
- If you want to refresh the token programatically from the connected system, also copy the Refresh Token.
All settings are available under menu [[ Settings ]] >> REST API (Available in Developer Mode)
TODO
- Open menu
[[ Settings ]] >> Dashboard - In REST API section you can see Quantity of Models available via API
- Click button
[Manage]to check or edit configuration - Click link
Publish OpenAPI (Swagger). Aswagger.jsonwill be made available under/api/v1/swagger.jsondocumentation of the tool / system you use on how to apply the Specification file there. Some examples are presented below.
Allows to review API
- Open http://editor.swagger.io/
- Click menu
File >> Import File - RESULT: You can see specification for API
- You can auto-generate SDKs in over 40 languages, there.
- Or even download server stups in over 20 frameworks, that iplement the API.