This Odoo module provides a secure REST API endpoint to create contacts using Bearer Token authentication.
It validates input, prevents duplicates, and returns structured JSON responses.
- JSON endpoint:
/create/contact - Authentication via Bearer Token
- Validates required fields (
name,mobile,email) - Prevents duplicate contacts (by email or mobile)
- Returns contact details on success
- Error handling for missing fields, duplicates, or invalid token
- Clone this repository into your Odoo addons path:
git clone https://github.com/hra0123/odoo-contact-creation-api-bearer.git
- Restart your Odoo service.
- Activate developer mode in Odoo.
- Install the Contact Creation API module from the Apps menu.
POST /create/contact
Authorization: Bearer <your_token>
Content-Type: application/json
{
"params": {
"name": "John Doe",
"mobile": "+971500000000",
"email": "john.doe@example.com"
}
}{
"status": "success",
"contact_id": 45,
"contact_name": "John Doe"
}{
"statusCode": 400,
"statusDescription": "Missing required fields",
"error": "Missing: email"
}- Odoo 18.0
contactsmodule
- Muhammed Aslam
LinkedIn
This module is licensed under the LGPL-3 license.