Send Text message

This endpoint sends a text message to a phone number on WhatsApp.

URL:​ ​https://waapi.pepipost.com/api/v2/message/

Method: POST

Parameters

Parameter

Description

Data Type

Required

recipient_whatsapp

Recipient’s phone number. Must be a valid number. Phone number must include a country code otherwise message might not get delivered.

String

Yes

recipient_type

Indicate whether the recipient is an individualor a group.

Specifying recipient_type in the request is optional when the value is individual. However, recipient_type is required when using group.

String

No

message_type

Type of a message.

Default : text

String

Yes

source

Source id of the origin.

String

No

preview_url

If you have any URL in the content and you would like to showcase preview then give true else false

Boolean

No

content

Message text

String

Yes in Text type message

x-apiheader

Any custom data which user needs to send. X-apiheader can be used instead of message id for mapping messages

String

No

Request Body

{ 
  "message": [
  { 
    "recipient_whatsapp": "919869566055",
    "recipient_type": "individual", 
    "message_type": "text", 
    "source": "fa9d647a-c8d7-423e-bd27-7d2ca2875dc1", 
    "x-apiheader": "custom_data", 
    "type_text": [
    { 
      "preview_url": "false | true", 
      "content": "your-text-message-content" 
    }] 
  }
] 
} 
 

Responses for message API

In case of success

{ 
   "status": "success", 
   "message": "Request received successfully.", 
   "data": { 
       "id": "6929d4af-490d-454a-8cf3-0502a3506f09" 
   } 
} 

This id in response is message id for future response. All the message status updates on webhook will be mapped to this id. So store this message id at your side.

In case of failure

{ 
   "status": "failure", 
   "error": { 
       "code": "8006", 
       "message": " type is required." 
   } 
} 

According to error code and message will change.

Last updated