I'm Guide API Documentation
    I'm Guide API Documentation
    • I'm Guide - API Version Control
    • I'm Guide - Custom Error Exception
    • Planner
      • Route
        • Popular Route V1
        • Popular Route [V3] Combind
        • Popular Route AI [V2]
        • Route Detail V1
      • Place
        • Region Place V1
        • Place LIST V2 With Favorite Flag
        • Region Place V2 - include fav flag specific user
        • Place LIST V1
        • Place Detail - ATTRACTION V1
      • Custom Trip
        • Delete Custom Trip V1
        • Create trip with ai prompt
        • Optimize trip with ai prompt
        • Create Custom trip V1
        • Edit Custom Trip V1
        • VIew Detail User Custom Trip V1
        • VIew List of User Custom Trip V1
        • Create trip with custom presetdata
        • Create trip with popular presetdata
        • Review Trip V1
        • Get Unavaliable Date List V1
        • Check Unavaliable Date V1
        • Create trip with ai prompt V2
        • VIew List of User Active Trip V1
      • Active Trip
        • Get Active Trip V1
      • Config
        • Get Province
        • Get Place-Keyword
      • Activities
        • Add Fav V1
        • Add view Details Logs v1
        • Add and Update Preference v1
        • Remove Fav V1
        • Clear details Logs v1
        • Get Fav V1
        • Get Fav By Province V1
        • Get Fav By Id V1
        • Get view details Logs v1
        • Get Preference Question v1
        • Get Preference V1
        • Get Analytics AI Data
      • Communities
        • Add to community
        • Get Communities
        • Get Web Content Communities
        • edit post in community
        • delete post in community - soft delete
      • Feedback
        • Add Feedback
        • Get Feedback Web-Admin
      • Internal Endpoint
        • sync TAT ROute Data
        • sync community orderjob
        • Get Route AI Data
        • Untitled Endpoint
        • LINE SYNC CURRENT TRIP
      • Line
        • Get List Of Linked Trip In Group V1
        • Get Detail Of Linked Trip In Group V1
        • Get Day Detail Of Linked Trip In Group V1
        • Generate Link Code V1
        • Verify Link Code V1
        • Unlink From LIne V1
        • Unlink From App V1
        • Get Current Trip In Group V1
        • Get Current Trip By Day In Group V1
        • Init Line
        • Update Line Line Notification
        • Update General Line Notification
        • Get Noti Trip Line
        • LINE GET TODAY TRIP BY DAY
        • LINE GET TODAY TRIP
        • LINE GET TODAY TRIP
        • Get Noti General Line
    • Core
    • AI
      • AI Progress Notification
      • INTERNAL: getPlaceInProvince
        POST
      • UAT
        POST
    • Storage
      • File Upload
        POST
      • Get File
        GET
      • Get File List ADMIN
        GET
    • Internal
      • AI
    • TEST TAT
      GET

    I'm Guide - Custom Error Exception

    Overview#

    This document outlines the custom error codes used in the API service. Each error code provides detailed information about the issue encountered during the API request, aiding in efficient debugging and resolution.

    Current Version#

    Document Version: 1.0#

    Release Date: Nov 30, 2024#

    Basic Response Error Format#

    All API error responses follow a standardized JSON structure:

    Response Field Description#

    FieldTypeDescription
    statusCodeintegerAn HTTP error code indicating the specific error type.
    errorstringA brief HTTP error code title describing the error.
    messagestringA detailed description of the specific error.

    I'm Guide Custom Response Error Format#

    Custom Response Field Description#

    Error CodeHTTP ErrorMessageDescription
    400100400Invalid DataThe input data does not match the required pattern or format.
    400200400Not EnoughInsufficient data provided to complete the requested task.
    Only Some Endpoints Have Custom Status Codes. Check the endpoints referenced in the next part of this document.
    Custom error responses follow this structure:

    Custom Response Field Description#

    FieldTypeDescription
    statusstringA unique custom error code to identify the error.
    messagestringA brief, human-readable description of the error in English.
    dataobjectContains additional details about the error, such as Thai translations or context-specific fields.
    th_messagestring(Optional) A user-friendly error message in Thai, providing a localized explanation.
    Other fieldsanyAny other relevant data about the error (e.g., counts, input parameters).

    Endpoints Using Custom Error Codes#

    HTTP MethodEndpointCustom Error Codes
    POST/trips/v1/custom/preset400100, 400200
    Ensure you handle custom error codes only for these endpoints

    Best Practices for Using Error Codes#

    1.
    Use status for Identification: Always refer to the status field to programmatically identify specific error cases.
    2.
    Display message to Users: Use the message field for general-purpose error handling in English.
    3.
    Leverage th_message for Localization: When targeting Thai-speaking users, show the th_message field for improved user experience.
    4.
    Log data for Debugging: Include the data field in logs for detailed diagnostics and troubleshooting.
    Previous
    I'm Guide - API Version Control
    Next
    Popular Route V1
    Built with