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: [email protected]
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 JSON404 Not Found
: User not found and creation failed500 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: [email protected]
Last updated
Was this helpful?