Sending integrated payment links via SMS

Sending integrated payment links can be done via the HTTP API by way of one-at-a-time injection. This means you can use your existing connection to our API to generate payment links easily and efficiently and send it off to a customer in one shot.

Currently, there is a 1 link per second limit which can be raised on a case-by-case basis.

Essentials:

API host: smsapi.totalsend.com

Type: JSON

Action: message_send()

Example: http://smsapi.totalsend.com/json/3?action=message_send

message_send()

This method is for sending a single transactional message.

Arguments

ArgumentTypeDescription
usernamestringYour TotalSend username
passwordstringYour TotalSend password
tostringThe mobile number that must receive the SMS
textstringThe content of the message. Must contain #payment# tag.
fromstringThe from number of the message (source address)
report_maskintDelivery report request bitmask (see delivery_report_mask_* variables)
report_urlstringURL to call when delivery status changes. More info.
charsetstringCharacter set to use (defaults to UTF-8)
data_codingintData coding (see data_coding_*)
auto_detect_encodingintAuto detect the encoding and send appropriately (useful for sending Arabic, Hindi, Unicode etc. messages) 1 = on, 0 = off, defaults off.
binfostringamount%3D250customerref%3D212X3rtorganisation_Id%3D300Where the amount is 250, the customer reference is 212X3rt and the organisation ID is 300.This needs to be in one line, separated by + signs.E.g.: amount%3D250+customerref%3D212X3rt+organisation_Id%3D300

#payment#

It is important to add this macro parameter to the message body so that the system knows where to insert the link. The #payment# macro will be replaced by the link.

URL Encoding

It is important to encode your URLs otherwise the payment link will not integrate correctly.

You should always test to yourself first. The examples below show encoded URL’s.

Examples:

Original API call:

http://smsapi.totalsend.com/json/3?action=message_send&username=customer&password=XXXXxxxx&from=Company&text=Please+click+%23payment%23+link&to= 27821231234&binfo=amount%3D250+customerref%3D212X3rt+organisation_Id%3D300

In the return result, if successful the details key will contain the message ID.
Example output:

{"status":1,"message":"Sent","description":"","details":"2528176b-dcd5-4383-0107-060800000006"}

Resulting message:

Please click https://mp.totalsend.com/u/uighjyt67 link