Send SMS

Signature SMS

All requests that enter espay system will be signature validated. Signature sent on each request with signature parameters. Each signature will be hashed using sha256 algorithm. The signature will be generated by multiplying some values from the previous value parameter and with a key provided by espay. Signature formats differ from any service. Each parameter will be started, separated, and terminated with ##. All values will be changed to uppercase. The signature sequence order as follows:

  1. sender_id
  2. rq_uuid
  3. message_type
  4. phone_number
  5. signaturekey

So the signature merge format will be as follows

#sender_id#rq_uuid#message_type#phone_number#signaturekey#
Generated signature example

First format

#SGOPLUS#smspr-test-011#SMS#6281218816222#

Change to uppercase

#SGOPLUS#SMSPR-TEST-011#SMS#6281218816222#

Add the signature key

#SGOPLUS#SMSPR-TEST-011#SMS#6281218816222#sgoplus201711aa#

Hash with sha256 algorithm

3ac657060474d31095e27eb49699098c81b317ca9d34e39489c9f77ba80ab758

API URL

development: https://sandbox-api.espay.id/btext/send/outgoing
production: https://api.espay.id/btext/send/outgoing

Send SMS

Parameter request

Parameter Name Attribute Mandatory Description
rq_uuid 64 Yes Request identifier. Unique id to identify these messages with other messages
sender_id 32 Yes Sender Identifier, will be given by espay.
message_type 3 Yes Fill fix value = SMS
phone_number 14 Yes Sender cell number
message 200 Yes Request message text
signature 64 Yes Signature (see signature algorithm)

Parameter Response

Parameter Name Attribute Mandatory Description
rq_uuid 64 Yes Request identifier. Unique id to identify these messages with other messages
rs_datetime 19 Yes Transaction date in application server
Format : YYYY-MM-DD HH:MM:SS Ex : 2014-12-17 12:30:45
error_code 4 Yes Error code
error_message Yes Error description

Error Code List

Error Code Error Message
0000 success
0041 Invalid Recipient
0601 IP Address Rejected / Unregistered
0001 invalid request
0096 invalid message type
0050 Parameters Should be not empty
0015 Unable to process, please contact your administrator
0401 Action decline
800 Insufficient balance
0011 Invalid signature
  
  

Sample Request

POST /btext/send/outgoing HTTP/1.1 Host: sandbox-api.espay.id 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=SMS &phone_number=6285333332113 &message=noteshere &signature=3ac657060474d31095e27eb49699098c81b317ca9d34e39489c9f77ba80ab758
  

Sample Response

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