Send Message to a group

In your account, there must be an existing group and numbers under that group to send any message to a group. API for sending a simple message to a group is in the following format:

curl -X POST \
'<BASE_URL>&method=groups&name=MyGroupName&sender=AAAAAA&message=sms+test'

An API for sending a customized message to a group is in the following format:

curl -X POST \
'<BASE_URL>&method=groups&name=MyGroupName&sender=AAAAAA&message=Dear {name}, Your email is {email}'

Here, {name} and {email} would be variable parameters and will be picked up from the existing group MYGROUP corresponding to each mobile number. Response formats would be same for simple message to a group or a customized one.

API Parameter Specifications

The API parameter specifications are described in the following sections.

Mandatory Parameters

The mandatory parameters in the HTTP API are tabulated below:

Parameter Description Expected Values
BASE_URL URL of your SMS Service URL
method Predefined method groups
sender Sender ID assigned to your account Sender ID (6 alphabets)
name Group name group name
message Message to be sent Message text which is URL encoded(1000 char for normal, 500 for unicode)

Optional Parameters

The Optional parameters in the HTTP API are tabulated below:

Parameter Description Expected Values
format Output format should be as specified by this variable XML/PHP/JSON/JSONP. Default response will be in JSON
id groupd id Comma separated group ID

Example Responses

JSON

 {
    "status": "OK",
    "message": "Submitted successfully",
    "data": {
        "0": {
            "id": "4429996893:1",
            "customid": "",
            "customid1": "",
            "customid2": "",
            "mobile": "88xxxxxxxxx",
            "status": "AWAITED-DLR"
        },
        "1": {
            "id": "4429996893:2",
            "customid": "",
            "customid1": "",
            "customid2": "",
            "mobile": "97XXXXXXXX",
            "status": "AWAITED-DLR"
        },
        "group_id": 4429996893
    }
}

Error Response

{
    "status": "ERROR",
    "code": "A421",
    "message": "Group is empty/Invalid group"
}

Response Data

Field Description
status It indicates the success or failure of your request.
message It indicates the success or failure message.
group_id Website group id for your reference
data All the response is wrapped in side data
groups Each number will be wrapped inside groups
id Website message id for your reference
customid Custom message id if you provide one
customid1 Custom message id 1 if you provide one
customid2 Custom message id 2 if you provide one
mobile Mobile number the sms will be sent
status status of the message

API Error Codes

Code Description
A420 Group name/id missing
A421 Group is empty/Invalid group
A422 Invalid mobile number
A423 Group name/number missing
A424 Group Name does not exist!
A425 Number does not Exist