Authentication
Login
Authentication refers to the process of verifying that a user is who they say they are (e.g. logging in with a username and password
Will response with ‘session_id’ in cookies, what will be need set for other request in headers
POST /api/v1/authenticate/login
Headers:
{ "Content-Type": "application/json"}Body:
{ "db": "some_db", "login": "admin", "password": "SomePassword"}Get from response cookies session_id
Get user_id from response
Response:
{ "uid": 2, "is_system": true, "is_admin": true, "is_internal_user": true, "user_context": { "lang": "de_DE", "tz": "Europe/Berlin", "uid": 2 }, "db": "some_db", "user_settings": { "id": 1, "user_id": { "id": 2 }, "is_discuss_sidebar_category_channel_open": true, "is_discuss_sidebar_category_chat_open": true, "push_to_talk_key": false, "use_push_to_talk": false, "voice_active_duration": 0, "volume_settings_ids": [ [ "ADD", [] ] ] }, "server_version": "17.0", "server_version_info": [ 17, 0, 0, "final", 0, "" ], "support_url": "https://www.odoo.com/buy", "name": "Administrator", "username": "admin", "partner_display_name": "Administrator", "partner_id": 3, "web.base.url": "http://localhost", "active_ids_limit": 20000, "profile_session": null, "profile_collectors": null, "profile_params": null, "max_file_upload_size": 134217728, "home_action_id": false, "cache_hashes": { "translations": "e41005f460ec682f9a4d1dbff11462a9ec7e1e98", "load_menus": "63dc6abccb64dd114674ff03fdb48d1cc379bcf395136d59a9394fdb3f6e3d68" }, "currencies": { "125": { "symbol": "€", "position": "after", "digits": [ 69, 2 ] }, "1": { "symbol": "$", "position": "before", "digits": [ 69, 2 ] } }, "bundle_params": { "lang": "de_DE" }, "user_companies": { "current_company": 1, "allowed_companies": { "1": { "id": 1, "name": "CTT Group", "sequence": 0, "child_ids": [], "parent_id": false, "has_appsbar_image": false, "has_background_image": false } }, "disallowed_ancestor_companies": {} }, "show_effect": true, "display_switch_company_menu": false, "user_id": [ 2 ], "max_time_between_keys_in_ms": 100, "dialog_size": "minimize", "web_tours": [], "tour_disable": false, "notification_type": "email", "odoobot_initialized": true, "chatter_position": "side", "iap_company_enrich": false, "is_quick_edit_mode_enabled": false}Session (Authenticate status)
Get session info
Set cookie: session_id value what we got from authenticate
POST /api/v1/authenticate/status
Headers:
{ "Content-Type": "application/json", "Cookie": "session_id=4e21fd7bf236b7d283b471254b8c94a57c8a3a08"}Request Body:
{}Response:
{ "uid": 2, "is_system": true, "is_admin": true, "is_internal_user": true, "user_context": { "lang": "de_DE", "tz": "Europe/Berlin", "uid": 2 }, "db": "some_db", "user_settings": { "id": 1, "user_id": { "id": 2 }, "is_discuss_sidebar_category_channel_open": true, "is_discuss_sidebar_category_chat_open": true, "push_to_talk_key": false, "use_push_to_talk": false, "voice_active_duration": 0, "volume_settings_ids": [ [ "ADD", [] ] ] }, "server_version": "17.0", "server_version_info": [ 17, 0, 0, "final", 0, "" ], "support_url": "https://www.odoo.com/buy", "name": "Administrator", "username": "admin", "partner_display_name": "Administrator", "partner_id": 3, "web.base.url": "http://localhost", "active_ids_limit": 20000, "profile_session": null, "profile_collectors": null, "profile_params": null, "max_file_upload_size": 134217728, "home_action_id": false, "cache_hashes": { "translations": "e41005f460ec682f9a4d1dbff11462a9ec7e1e98", "load_menus": "63dc6abccb64dd114674ff03fdb48d1cc379bcf395136d59a9394fdb3f6e3d68" }, "currencies": { "125": { "symbol": "€", "position": "after", "digits": [ 69, 2 ] }, "1": { "symbol": "$", "position": "before", "digits": [ 69, 2 ] } }, "bundle_params": { "lang": "de_DE" }, "user_companies": { "current_company": 1, "allowed_companies": { "1": { "id": 1, "name": "CTT Group", "sequence": 0, "child_ids": [], "parent_id": false, "has_appsbar_image": false, "has_background_image": false } }, "disallowed_ancestor_companies": {} }, "show_effect": true, "display_switch_company_menu": false, "user_id": [ 2 ], "max_time_between_keys_in_ms": 100, "dialog_size": "minimize", "web_tours": [], "tour_disable": false, "notification_type": "email", "odoobot_initialized": true, "chatter_position": "side", "iap_company_enrich": false, "is_quick_edit_mode_enabled": false}Check
Check current session is valid
Set cookie: session_id value what we got from authenticate
POST /api/v1/authenticate/check
Headers:
{ "Content-Type": "application/json", "Cookie": "session_id=4e21fd7bf236b7d283b471254b8c94a57c8a3a08"}Request Body:
{}Response:
nullLogout
Destroy current session
Set cookie: session_id value what we got from authenticate
POST /api/v1/authenticate/check
Headers:
{ "Content-Type": "application/json", "Cookie": "session_id=4e21fd7bf236b7d283b471254b8c94a57c8a3a08"}Request Body:
{}Response:
null