WhatsApp Message Middleware API

Version 1.0.0

Base URL: https://wb.pvstravel.co.uk/api

Description

API for sending WhatsApp messages

Endpoints

GET

/

API documentation

GET

/test

Test endpoint

POST

/send-message

Send a WhatsApp message

Parameters

Parameter Type Required Description
to string Yes Recipient phone number
message string Yes Message content or caption
type string Yes Message type (text, image, document, audio, voice, video)
media_url string No* URL of the media file (required for media types)
reference_id string No Reference ID for tracking

Notes

  • The media_url parameter is mapped to the appropriate field in the API:
  • - For images: media_url -> image
  • - For documents: media_url -> document, and filename is required
  • - For audio/voice: media_url -> audio/voice (both "audio" and "voice" types are supported)
  • - For video: media_url -> video
  • The message parameter is used as the caption for media messages.
  • For document messages, if filename is not provided, it will be extracted from the media_url.

Examples

Text Message
{
    "to": "+201012121146",
    "message": "Hello, this is a test message",
    "type": "text"
}
Image Message
{
    "to": "+201012121146",
    "message": "Check out this image",
    "type": "image",
    "media_url": "https://offline.umrah.software/images/logo.png"
}
Audio Message
{
    "to": "+201012121146",
    "message": "Listen to this audio message",
    "type": "audio",
    "media_url": "https://file-example.s3-accelerate.amazonaws.com/audio/2.mp3"
}
Voice Message
{
    "to": "+201012121146",
    "message": "Listen to this voice message",
    "type": "voice",
    "media_url": "https://file-example.s3-accelerate.amazonaws.com/voice/oog_example.ogg"
}