YetAnotherAPI Documentation
Signup for APIGo to main websiteContact Support
  • API Documentation
    • YetAnotherAPI Overview
    • Authentication
  • Integrations
    • Pabbly-Connect
  • Document parser
    • PDF Parser
    • Doc Parser
    • PNG & JPG Parser
    • TXT Parser
    • Parser Processing Status
  • Web Scrapper [deprecated]
    • Basic Web Scraper
    • LLM Web Scraper
    • Scrapper Processing Status
  • Web Scraper
    • Basic Web Scraper
    • Webpage links Scrapper
    • Metadata Scrapper
    • Webhook Notification
    • Status Check
  • LLM Web Scraper
    • Basic Text
    • Structured JSON
    • Best Practices
    • Use Cases
    • Status Check
  • UChat Webhook System
Powered by GitBook
On this page
  • Overview
  • Authentication
  • Endpoints
  • Error Handling
  • Logging and Monitoring
  • Support

Was this helpful?

UChat Webhook System

Overview

The Bot Webhook API provides functionality to manage user interactions in a messaging system, including user creation, field updates, and flow management. This API integrates with uChat's backend API services.

Important Notes:

  • This API is FREE and will continue to remain free.

  • IMPORTANT: Authentication process will be updated in future releases.

  • Currently works best for whatsapp bots. We plan to expend this to support multiple channels.

  • For support contact: hey@manojlk.work

Endpoint URL: https://api.yetanotherapi.com/bot-webhook

Authentication

All API requests require Bearer token authentication.

Authorization: Bearer <your_api_token>

Your API token can be obtained from the UChat account settings.

Endpoints

Send Bot Webhook

POST /bot-webhook

Handles user management and flow distribution in the messaging system.

Request

Headers:

  • Content-Type: application/json (Required)

  • Authorization: Bearer <token> (Required)

Body Parameters:

{
    "phone_number": string,     // Required: User's phone number
    "flow_ns": string,         // Required: Flow namespace identifier
    "user_fields": {           // Optional: Custom user fields
        "field_name": "value"
    }
}

Response

Success Response (200 OK)

{
    "user_ns_retrieval": {
        "success": true,
        "message": string,
        "user_ns": string
    },
    "custom_fields_update": {
        "success": true,
        "message": string,
        "details": [
            {
                "field": string,
                "status": string
            }
        ]
    },
    "flow_sent": {
        "success": true,
        "message": string
    },
    "request_id": string
}

Partial Success Response (206 Partial Content) Returned when some operations succeed but others fail.

Error Responses:

  • 400 Bad Request: Missing required fields or invalid JSON

  • 404 Not Found: User not found and creation failed

  • 500 Internal Server Error: Server-side error

Each response includes a unique request_id in both the response body and header (X-Request-ID).

Example Request

curl --location 'https://api.yetanotherapi.com/bot-webhook' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your_token>' \
--data '{
    "phone_number": "917406796004",
    "flow_ns": "f105713s755621",
    "user_fields": {
        "scheme_name": "test",
        "transaction_code": "test"
    }
}'

Error Handling

The API implements a robust error handling system with:

  • Input validation

  • Retry mechanism (max 3 retries) for user retrieval

  • Detailed error messages in responses

  • Comprehensive error logging

Logging and Monitoring

All API interactions are logged with:

  • Request details

  • API call traces

  • Execution timestamps

  • Response data

  • Error information

Each request can be tracked using its unique request_id.

Support

For any queries or support, please contact: hey@manojlk.work

PreviousStatus Check

Last updated 4 months ago

Was this helpful?