Webhook API Documentation

API Explorer

API Usage Guide

Overview

This API provides a webhook for managing user subscriptions. It allows creating or upgrading user subscriptions based on phone number and subscription duration.

Endpoint

POST https://auto.dev.tv24.vn/webhook/098ad862-0ce0-4f01-8302-40880b476ddb

Authentication

Use the Authorization header with your API token:

Authorization: <tokenapi>

Required Headers

  • phone: 10-digit phone number (e.g., 0987654321)
  • month: Subscription duration in months (3-6, e.g., 3)

Response Codes

  • 200: User created, subscription upgrade succeeded.
  • 201: User already exists, subscription upgrade succeeded.
  • 302: User exists with Premium subscription, no action taken.
  • 500: User exists, upgrade failed, try again later.
  • 505: API failure, contact admin at 0963999252.

Example Request (cURL)

curl -X POST "https://auto.dev.tv24.vn/webhook/098ad862-0ce0-4f01-8302-40880b476ddb" \
-H "Authorization: <tokenapi>" \
-H "phone: 0987654321" \
-H "month: 3" \
-H "subname: premium or premium_plus"
          

Testing with Swagger UI

Use the Swagger UI on the left to test the API:

  1. Expand the POST endpoint.
  2. Click "Try it out".
  3. Enter your Authorization token, phone, and month in the headers section.
  4. Click "Execute" to send the request and view the response.