User Guide - ValueFirst - HTTP API
User Guide - ValueFirst - HTTP API
Introduction 3
Overview Of Service 3
Sender ID Consideration 3
Character set support 3
Message Length 3
Using Service 4
End Point 4
Service Response 4
Extended Parameters 5-6
Using UDH for Wake-up Messaging 7
Sending Binary Messages 9
Sending Ringtones 10
Sending Bulk Messages 10
DLR URL 11
Message Status Error Code 12
Application Constraints (For bulk messages only) 12
HTTP Status Pull API 13
Regulatory Implementation and Impact 14
Sender ID Regulation 14
National Customer Call Preference Registry (NCCPR) 15
Introduction
Overview of Service
ValueFirst HTTP SMS service is designed to let end user send across SMS messages
using HTTP interface. The API supports custom UDH, flash messages, message
scheduling (if supported by operator) and various other advance features.
The API is specially designed to let user send custom UDH while sending messages.
Message Length
If a message is sent whose length is longer than permitted characters limit, it shall be
counted as multiple messages, however will be delivered on handset as a single
message.
For standard Latin character set 160 characters per SMS is supported. If SMS text
is longer than 160 characters, messages shall be calculated in multiples of 153
characters.
For Unicode messaging (non-English) only 70 characters per SMS is supported. If
Unicode SMS text is longer than 70 characters, messages shall be calculated in
multiples of 67 characters.
For Binary messaging 140 characters including UDH is supported. If Binary SMS
is longer than 140 characters, messages shall be calculated in multiples of 134
characters.
Accessing Server Services
The username and password shall be provided by your account manager from ValueFirst. This
authorisation information will be required to generate a bearer token which will be further used for availing
the services of ValueFirst.
Token Management
A bearer token is used to perform the MT actions and can be managed using service username and
password. Following actions are linked to token:
1. Token Generation
2. Token Enable
3. Token Disable
4. Token Delete
Delete, enable and disable can be done for all tokens or for a specific given token as well.
To perform for any of the mentioned actions for all use “Token=all”.
Token Rotation
Token generated will have expiry date which is 7 days so new token need to be generated before old token get expiry. This
new token will further be used for MT actions. Please update your tokens timely to avoid any termination issues. An expiry date
of the token is provided in every response of token generation request.
Token Generation
Sample Request
URL: https://http.myvfirst.com/smpp/api/sendsms/token?action=generate
Request: POST
Authorization: Basic Auth
Sample Response
{
"token": "eyJhbKJKJKVibskuI1NiJ9.eyJpcBXMIYOBodHRwczovL2FwaS5teXZhbHVlZmlyc3QuY29tL3BzbXMiLCJzdWIiOiJkZW1vc29
1bXlheG1sMyIsImV4cCI6MTYxOTE4MDg3M30.rPuvLBiNoZKusW3GHTHoZCW-Nl9MMCHWLfo9gLjd66k",
"expiryDate": "2021-04-21 17:57:53"
}
Token Enable
URL:https://http.myvfirst.com/smpp/api/sendsms/token?action=enable&token=eyJhbKJKJKVibskuI1NiJ9.eyJpcBXMIYOBodHRwczovL2FwaS
5teXZhbHVlZmlyc3QuY29tL3BzbXMiLCJzdWIiOiJkZW1vc291bXlheG1sMyIsImV4cCI6MTYxOTE4MDg3M30.rPuvLBiNoZKusW3GHTHoZCW-
Nl9MMCHWLfo9gLjd66k
Token Disable
URL:https://http.myvfirst.com/smpp/api/sendsms/token?action=disable&token=eyJhbKJKJKVibskuI1NiJ9.eyJpcBXMIYOBodHRwczovL2FwaS
5teXZhbHVlZmlyc3QuY29tL3BzbXMiLCJzdWIiOiJkZW1vc291bXlheG1sMyIsImV4cCI6MTYxOTE4MDg3M30.rPuvLBiNoZKusW3GHTHoZCW-
Nl9MMCHWLfo9gLjd66k
Request: POST
Authorization: Basic Auth
Token Delete
URL:https://http.myvfirst.com/smpp/api/sendsms/token?action=delete&token=eyJhbKJKJKVibskuI1NiJ9.eyJpcBXMIYOBodHRwczovL2FwaS5
teXZhbHVlZmlyc3QuY29tL3BzbXMiLCJzdWIiOiJkZW1vc291bXlheG1sMyIsImV4cCI6MTYxOTE4MDg3M30.rPuvLBiNoZKusW3GHTHoZCW-
Nl9MMCHWLfo9gLjd66k
Request: POST
Authorization: Basic Auth
Service Response
When data is posted on HTTP API, the following responses are generated.
Response Description
Sent. Message sent Successfully
Sent. Split into N Message was sent, however it was found
to be longer
than permitted limit and hence was spitted
into multiple messages
Number(s) has/have been denied by Invalid Recipient numbers.
white- and/or black- lists.
Empty receiver number not allowed, Recipient number is empty.
rejected
Sender missing and no global set, Sender number is missing.
rejected
Empty text not allowed, rejected. Message Text is empty.
unknown request Kannel is down or SMSC connectivity
problem.
Authorization failed for sendsms Invalid Username and Password.
Extended Parameters
The followings are the extended parameter supported by ValueFirst HTTP API. Please
note that all variables are in small case.
UDH is used for sending long messages that are assembled at Mobile device level into
one SMS. UDH is also used for sending specialized messages like Ringtone, logo, picture
messages, vCard, vCAL and messages to custom mobile applications.
The most common use of UDH is to send message to a specific port (called destination
port). Since each port has a different meaning on mobile phone, mobile phone
understands message content according to port of the message.
The following are the standard ports:
The UDH parameter which is usually 12 bytes hex content need to be setup in following
manner:
However if the message can be accommodated in 1 SMS only then you may change the
UDH length as well as remove elements related to message concatenation information.
The new UDH may look like following:
For single message case your UDH has now become &udh=%06%05%04%15%82%00%00
Sending Binary Messages
ValueFirst HTTP SMS service can be used to send binary messages. To send binary
messages to CDMA numbers, client need to send well formed user data header failing on
which service will return an error. Binary message text must be prefixed with well formed
user data header.
However, if message text can be sent in one SMS only then, we may change the user data
header as i.e.
Ex: 024A3A650995D1D195C93D999804144288F511610611624D30831445
Udh part for given ring tone would be //SCKL1581+ so the URL encoded text
parameter would be as:
%2F%2FSCKL158A000000+024A3A594D8549951D84040018D9049161361561661861
A61C 6288B000
Customer can use following sample URL in the http request to send bulk message:
Sample URL:
https://xxx.xxx.x.xxx/sendsms?to=9198xxxxxxxx,9199xxxxxxxx&from=Senderid&text=this%20is
%20a%20test%20message&category=bulk
DLR URL
Customer can use following sample URL for receiving the DLR:
https://ip/app/status?unique_id=%7&reason=%2&to=%p&from=%P&time=%t&status=%d
https://http.myvfirst.com/smpp/sendsms?username=XXXXX&password=XXXXXX&to=91
XXXXXXXXXX&udh=&from=VFIRST&text=This%20is%20a%20test%20SMS%20flash%
20SMS&category=bulk
A GUID is returned to the user acknowledging successful submission (with errorcode=0)
guid=XXXXXXXXXXXXXXXXXXXXXHTTP&errorcode=0&seqno=91XXXXXXXXXX
• Using the GUID user can check the delivery status using following URL by providing their
username, password along with the GUID.
https://http.myvfirst.com/smpp/status?username=XXXXXXX&password=XXXXXXXX&guid=k
h4rc500404XXXXXXXXXXXXXXX
• If multiple mobile numbers is submitted it will return comma separated mobile number wise
response.
OR
• User can pass mobile number along with GUID to get status of a particular mobile number.
Mobile number is an optional field.
ALL THE DLT AND OPERATOR RELATED DLR ERRORS CODES THAT MAY COME
ACROSS IN VALUEFIRST ARE LISTED BELOW:
Sender ID Regulation
Telecom Regulatory Authority of India (TRAI) has given a direction to all telecom service provider
of India to prefix an Identification Code before SenderID for every message sent using alpha and
numeric sender id. The Direction can be downloaded directly from TRAI website or simply by
clicking following link:
https://www.trai.gov.in/WriteReadData/trai/upload/Directives/131/direction10dec08.pdf
The Identification Code will be of three characters, consisting, Service Provider Code and
Service Area Code, followed by a Hyphen character. Hence, the maximum length of a sender
ID has been fixed to 6 characters for alpha and numeric both.
The details of operator codes are as below:
www.vfirst.com
27
www.vfirst.com
28
29