• Demo
  • Contact us
  • Log in
  • Sign up
  • English (US) Tiếng Việt
ERPOnline
  • Introductions
    • Features Overview
    • Integrated Apps & Modules
  • Pricing
  • Services
    • Odoo Implementation & Consultancy
    • Odoo Training
    • Odoo Customization On-demand
    • Odoo Upgrade Service
  • Solution
    Giải pháp theo nghiệp vụ Quản lý Quan hệ khách hàng Quản lý Bán Hàng/Dịch vụ Quản lý Mua sắm Hoạch định nguồn lực Sản xuất (MRP) Quản lý Nhân sự (HRM) Kế toán TC (Financial Accounting) Kế toán QT (Analytical Accounting) Bán lẻ với POS (Point of Sales) Thương mại điện tử tích hợp
    Giải pháp Chuyên Ngành ERP cho DN sản xuất ERP cho DN Thương mại & Dịch vụ ERP cho Siêu thị, Cửa hàng bán lẻ ERP cho ngành Đóng tàu ERP cho DN Du lịch & Lữ hành ERP cho Trường học ERP cho DN vận tải hành khách
  • Help
    • User Manuals
    • Helpdesk
  • Appointment
  • 0
  • 0
  • Sign in
Contact Us
  1. APPS
  2. API Request Logger 17.0
API Request Logger
API Request Logger

API Request Logger

by Viindoo

4.9

$ 31.35 $ 31.35
v 17.0 0
Live Demo Demo Video
Lines of Code 385
Technical name viin_api_request_logger
License OPL-1
Website https://viindoo.com/apps/app/17.0/viin_api_request_logger
Read description for
Extensions Viindoo Unified Routing Framework HERE Routing API Integration Google Routes API Integration Vietmap Matrix & Routing API Integration Mapbox Matrix API Integration SeaRoutes Ocean Routing Integration
  • Description
  • Documentation
  • License

Demo video: API Request Logger

### Viindoo API Request Logger

A comprehensive solution for managing and monitoring API requests in Odoo. The Viindoo API Request Logger provides developers with a centralized system to log and analyze API interactions, ensuring debugging efficiency, compliance, and detailed insights into external service integrations.

#### Key Features: - Automatically record all API requests and responses with parameters, results, and execution time. - Track user activities and the originating model or record for each request. - Maintain logs for debugging, performance analysis, and audit trails. - Easy-to-integrate with any Odoo module using a mixin-based architecture.

#### Ideal For: - Odoo developers who frequently work with external API integrations. - Businesses requiring traceability of API requests for compliance and debugging. - Teams managing complex multi-system interactions.

#### How It Works: 1. Integration: Add viin_api_request_logger as a dependency to your module. 2. Usage: Inherit the api.request.mixin in your models to enable automatic logging. 3. Analysis: Access the logged data from the interface for debugging or compliance audits.

Visit our [documentation](https://viindoo.com) for detailed implementation guides.

Editions Supported

  1. Community Edition
  2. Enterprise Edition

API Request Logger Documentation

Overview

The viin_api_request_logger module provides a framework for logging and monitoring API requests in Odoo. Designed for developers and administrators, it tracks all details of API interactions, including:

  • User initiating the request
  • Related model and record
  • Request parameters, headers, and payload
  • API response data and errors
  • Request duration

Key Features

  • Detailed Logging: Capture all request/response details, including errors.
  • Error Monitoring: Automatically logs failed API requests for better debugging.
  • Extensible Integration: Easily integrate with models using the provided mixins.
  • User-Friendly API Log Viewer: Quickly access logs related to any model record.
  • Customizable: Fully adaptable for specific business needs.

Installation

  1. Install the module via the Odoo Apps interface or the command line:

    odoo-bin -c <config_file> -i viin_api_request_logger
    
  2. Configure user access rights to ensure secure access to logs.

Usage

Logging API Requests

To enable automatic logging for API requests, inherit the api.request.mixin in your model and use the make_request method. Here's an example:

class ExampleIntegration(models.AbstractModel):
    _name = 'example.integration'
    _inherit = 'api.request.mixin'

    def example_api_call(self):
        response = self.make_request(
            method="GET",
            url="https://api.example.com/data",
            headers={"Authorization": "Bearer <token>"},
            params={"key": "value"},
            res_model="example.model",
            res_id=1,
        )
        return response.json()

Viewing API Logs

To allow users to view related logs, inherit the api.log.viewer.mixin in your model. This mixin provides:

  • `last_api_request_log_id`: A computed field showing the most recent API log.
  • `action_view_api_logs`: An action to display all related logs.

Example:

class ExampleModel(models.Model):
    _name = 'example.model'
    _inherit = 'api.log.viewer.mixin'

Logs can also be accessed via the "API Logs" menu in the Odoo interface.

Customizing the Logger

Override _prepare_log_values to include custom fields in the log:

def _prepare_log_values(self, method, url, headers, data, response, duration, res_model=None, res_id=None, error_message=None):
    values = super()._prepare_log_values(method, url, headers, data, response, duration, res_model, res_id, error_message)
    values.update({"custom_field": "Custom Value"})
    return values

Configuration

The module works out-of-the-box but can be extended for advanced configurations.

Advanced Scenarios

  • Custom Headers: Use the headers parameter in make_request to add headers such as authentication tokens.
  • API Monitoring: Leverage the response_headers and response_data fields to debug or analyze responses.
  • Integration with External Tools: Export logs for use with monitoring tools like ELK Stack or Datadog.

Support

For assistance, please contact Viindoo support at https://viindoo.com.

This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file).

You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one).

It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software.

The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

ERPOnline
Head Office: 6th Floor, Taiyo Building, No.97 Bach Dang, Hong Bang Ward, Haiphong, Vietnam
+84 225 730 9838
Business Code: 0201994665
Authorized by Haiphong Department of Planning and Investment
Logo Sale Noti MOIT
About Us
Information Contact Us Blogs Jobs
Resource
User Documentation Technical Documentation Github Runbot
Policy
Terms of use Privacy Policy Supporting Policies Data Security & Safety Payment Policy APGL V3 License 14 Days Refund ERPOnline Pricing ERPOnline Terms of Service Regulations on Q&A Forum
Service
Course Forum
ERPOnline is a trademark owned by Viindoo Technology Joint Stock Company
English (US) Tiếng Việt
Powered by Viindoo - Create a free website