/
Send/Schedule Bulk SMS to a Group

Send/Schedule Bulk SMS to a Group

Description

Send or Schedule a bulk SMS to a specific group. Accepts GET or POST requests.

URL

https://melotext.com/apis/smsgroup/

Example Call: https://melotext.com/apis/smsgroup/?apikey=APIKEY&from=FROMNUMBER&to=GROUPNAME&message=MESSAGE&rotate=1

PHP Code Sample (cURL):

$url = 'https://melotext.com/apis/smsgroup/'; $fields = array('apikey' => $api_key, 'from' => $from, 'to' => $to, 'message' => $message, 'rotate' => $rotate, ); $ch = curl_init($url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($fields)); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded')); $result = curl_exec($ch); return $result;

Parameters

Parameters

Required

Description

Parameters

Required

Description

apikey

Required

The API key of your account.

from

Required

The number you are sending from. Could be any SMS-enabled number in your account.

to

Required

The group name you are sending the message to. Must be a valid group name that exists in your group list.

message

Required

The message text you are sending. 1 credit is charged for each 160 character segment. If you have a message that is 300 characters, and you are sending to 10 people, 20 credits will be deducted (2 credits for each person).

NOTE: Messages containing non-GSM(unicode) characters will be charged 1 credit for each 70 character segment.

alphasender

Optional

This is the alphanumeric sender ID you want to send the message from. Only certain countries can send from an alphanumeric sender id, which are included below: AUSTRALIA, AUSTRIA, DENMARK, ESTONIA, FINLAND, FRANCE, GERMANY, HONG KONG, IRELAND, ISRAEL, LITHUANIA, NETHERLANDS, NORWAY, POLAND, SPAIN, SWEDEN, SWITZERLAND, UNITED KINGDOM

Alphanumeric SenderID requirements: Any combination of 1 to 11 letters(A-Z/a-z) and numbers(0-9). 1 letter and no more than 11 alphanumeric characters may be used.

rotate

Optional

Flag if you want to rotate through all your numbers in your account when sending the message. Set to 1 if you want to rotate. If nothing is passed in, it will NOT rotate through your numbers.

throttle

Optional

Sending throttle to control the sending rate of the message being sent. The default is 1, which will send the message at a rate of 1 SMS every 1 second per long code. If nothing is passed in, it will send at this rate. If you want to send a slower rate, you can pass in a 2, 3, 4, 5 or 6 which will send at a rate of 1 SMS every 2 seconds per long code, every 3 seconds, etc…The slowest setting which can be used is 6.

sendondate

Optional

If scheduling bulk SMS, this is the date/time message will be sent. If it's a recurring event, this is the 1st date/time in the series.

Format: DD-MM-YYYY HH:MM
Example: 20-03-2017 19:30

recurring

Optional

Create recurring events. Set to 1 if you want to create a recurring event.

repeat

Optional

Type of recurring event you want to schedule. Valid values are 'Daily', 'Weekly', 'Monthly', 'Yearly'.

frequency

Optional

How often you want the recurring events to happen based on the Repeat parameter above. For example, if you pass in 'Daily' for repeat and '3' for Frequency, it will schedule the events every 3 days. Valid values are 1-30.

enddate

Optional

End date you want the recurring events to end. For example, if you pass in a sendondate(start date) of Oct 10 at 6:30 and you want the last event to run on Nov 10, you must pass in an end date of Nov 10 at 6:30 so Nov 10 will be included as the last date.

Format: DD-MM-YYYY HH:MM
Example: 20-03-2017 19:30

Return Values

Return Code

Description

Return Code

Description

0

0 is passed back on successful API call when scheduling bulk SMS. The group SMS ID will be passed back on successful API call when sending bulk SMS immediately.

-1

Invalid API key passed in.

-2

There was no 'from' number passed in.

-3

The 'from' number passed in doesn't exist in your account or isn't SMS-enabled.

-4

There was no message passed in to be sent.

-5

There was no group passed in.

-6

The group passed in is invalid or does not exist.

-7

The alphanumeric sender ID passed in is either invalid(doesn't match requirements below) OR the user account does not have permission to send from an alphanumeric sender ID.
Requirements: You may use any combination of 1 to 11 letters(A-Z/a-z) and numbers(0-9). 1 letter and no more than 11 alphanumeric characters may be used.

-8

The rotate flag passed in is invalid. Proper values are either 1 or 0.

-9

The sending throttle flag passed is invalid. Proper values are 1, 2, 3, 4, 5, or 6.

-10

The recurring flag passed in is invalid. Proper values are either 1 or 0.

-11

The repeat parameter passed in is invalid. Proper values are 'Daily', 'Weekly', 'Monthly', 'Yearly'. Also, if recurring flag is 1 and nothing passed in for this field will trip this error.

-12

The frequency parameter passed in is invalid. Proper values are 1-30. Also, if recurring flag is 1 and nothing passed in for this field will trip this error.

-13

Must have a recurring end date if you want to schedule a recurring event. The recurring flag is 1 and nothing passed in for enddate.

-14

Not enough credits to send the message.

-15

No subscribers found in group.

-16

Other error.

-20

Level 1 does not have access to the API. API can only be used with Levels 2, 3, and 4.

Example API Response (data is returned in universal and lightweight JSON format)

{ "status":"-4", "msg":"There was no message passed in to be sent." }