Request
Method
Content Type
URL
POST
Application/JSON
https://sms-api.v-com.vn/api/v2/send-mt
Params
Param Name (Case-sensitive)
Type
Required
Description
client_id
string
required
client id, help to define client in partner system. Provided by V-COM
request_id
string
required
Request ID which partner received from Receive MO API
service_id
string
required
service number, eg 7068
command_code
string
required
Command code, eg: cskh, topup...
mt_code
string(50)
required
Help to define your mt, we'll not send duplicated MT base on this.
We will base on pair of request_id and mt_code to be unique
message
string
required
Message to send to user
is_charged
boolean
This will charge money from user or not, value must be one of 0 or 1
- 0: do not charge user
- 1: charge user (default value)
time
integer
required
current timestamp
checksum
string
required
Check sum of transaction
$checksum = base64_encode(hash('sha256', $client_id . $request_id . $mt_code . $secure_key . $time, true));
$secure_key: provided by V-COM
Note: We use
sha256 with
binary mode, the parameter with "true" indicates this
Response
V-COM will return JSON response
Status
Code
Response
success
200
{"data": { "code": 200, "status": "success", "message":"Thanks"}}
error
104
{"errors": {"code": 104, "status": "error", "message": "MT is duplicated"}}
error
106
{"errors": {"code": 106, "status": "error", "message": "Parameter is invalid, wrong checksum, ..."}}
error
108
{"errors": {"code": 108, "status": "error", "message": "Request from IP is not allowed"}}
error
102
{"errors": {"code": 102, "status": "error", "message": "Other errors, will be explained here"}}
* Notes: IMPORTANT
- If partner receive HTTP response code different to 200, please retry 2 more times, each time should be 20 seconds period
- Reference API:
- Receive MO API Document
Example
Sample secure key: 5fdc57e97198o1
curl --location --request POST 'https://sms-api.v-com.vn/api/v2/send-mt' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"client_id": "demo",
"request_id": "1297875832",
"service_id": "7068",
"command_code": "vuihe",
"mt_code": "giai_nhat",
"message": "Chuc mung ban trung 20k tien vuihe",
"is_charged": "1",
"time": 1692947422,
"checksum": "j4t5TN5jp4J/XtjerNfZXdleuDfwXBPcL5S4+ALD0DY="
}'