Send WhatsApp

Send WhatsApp is a service that allows you to integrate your application or system with the WhatsApp application, enabling automatic sending and receiving of messages.

Before Integration

Make sure you have received the credentials from the Espay team.

Integration Steps

You can use the following steps to integrate with Espay WhatsApp Gateway:

1. Generate Hash-Based Signature

Every request you send will be validated by the Espay Payment Gateway using the signature parameters you have created. Learn how to make a SMS & WA Gateway | Hash-Based Signature.

2. Send WhatsApp

Flow

You send the required parameters to make a request, and Espay will respond in JSON format.

API URL

Environment URL
Sandbox
http://domain.espay/btext/send/outgoing
Production
http://domain.espay/btext/send/outgoing

Headers

Key Value
Method
HTTP Post
Connection
keep-alive
Content-Length
250
Content-Type
application/x-www-form-urlencoded
Accept
*/*

Request Parameters​

Parameter Type Mandatory Description
rq_uuid
String (64)
Y
Request identifier. A unique ID used to identify messages.
sender_id
String (32)
Y
Sender ID from Espay team.
message_type
String (3)
Y
Message type.

Value:
WA
phone_number
String (14)
Y
Destination phone number.
temlate_id
String (64)
Y
The WhatsApp template to be used.
message
String (200)
Y
Message text.
broadcast
String (200)
O
Broadcast message delivery.

Format:
  • Yes: Y
  • No: N
signature
String (64)
Y
Code used to validate transactions. Learn SMS & WA Gateway | Hash-Based Signature.
Y: Yes, O: Optional, C: Conditional

Response Parameters

Parameter Type Mandatory Description
rq_uuid
String (64)
Y
Request identifier. A unique ID used to identify messages.
rs_datetime
String (19)
Y
Date and time of the transaction response from the Espay server.

Format:
YYYY-MM-DD HH:MM:SS

Example:
2014-12-17 12:30:45
error_code
String (4)
Y
Response code. See response code here.
error_desc
String
Y
Response description. See response description here.
Y: Yes, O: Optional, C: Conditional













































Sample Request

POST /btext/send/outgoing HTTP/1.1
Host: domain.espay
Connection: keep-alive
Content-Length: 250
Content-Type: application/x-www-form-urlencoded
Accept: */*

rq_uuid=fbd39734-ed32-490d-98c4-e91bcd91037a
&sender_id=21102509019CO9R
&message_type=WA
&phone_number=6285333332113
&template_id=otp_menit
&message=text:=:123456||text:=:2
&signature=3ac657060474d31095e27eb49699098c81b317ca9d34e39489c9f77ba80ab758
            
















Sample Response

{
    "rq_uuid": "baefa025e0ca44861a9076c8Z83fccxx",
    "rs_datetime": "2018-02-27 11:57:45",
    "error_code": "0000",
    "error_message": ""
}
            
Scroll to Top