Skip to content

Odoo 18 module providing a secure REST API to create contacts using Bearer Token authentication. Includes required field validation, duplicate checks (email/mobile), and structured success/error responses. Lightweight, depends only on contacts.

Notifications You must be signed in to change notification settings

hra0123/odoo-contact-creation-api-bearer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Contact Creation API (Bearer Auth) - Odoo 18

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.


πŸš€ Features

  • 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

πŸ“¦ Installation

  1. Clone this repository into your Odoo addons path:
    git clone https://github.com/hra0123/odoo-contact-creation-api-bearer.git
  2. Restart your Odoo service.
  3. Activate developer mode in Odoo.
  4. Install the Contact Creation API module from the Apps menu.

πŸ”§ Usage

Endpoint

POST /create/contact

Headers

Authorization: Bearer <your_token>
Content-Type: application/json

Example Request

{
  "params": {
    "name": "John Doe",
    "mobile": "+971500000000",
    "email": "john.doe@example.com"
  }
}

Example Success Response

{
  "status": "success",
  "contact_id": 45,
  "contact_name": "John Doe"
}

Example Error Response

{
  "statusCode": 400,
  "statusDescription": "Missing required fields",
  "error": "Missing: email"
}

πŸ›  Dependencies

  • Odoo 18.0
  • contacts module

πŸ‘¨β€πŸ’» Author


πŸ“œ License

This module is licensed under the LGPL-3 license.

About

Odoo 18 module providing a secure REST API to create contacts using Bearer Token authentication. Includes required field validation, duplicate checks (email/mobile), and structured success/error responses. Lightweight, depends only on contacts.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages