Add Contact to a Group
First, you need to create a group in your account only then you can add contact to an existing valid group. API for adding contact to a group will be in the following format:
curl -X POST \
'<BASE_URL>&method=groups.register&number=99xxxxxxxx&name=MyNum&action=add&fullname=xyz&email=xyz%40example.com'
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.register |
number | mobile number of the contact (With or without 91) | 99XXXXXXXX or 9199XXXXXXXX |
name | group name | case insensitive |
Optional Parameters
The optional parameters in the HTTP API are tabulated below:
Parameter | Description | Expected Values |
---|---|---|
fullname | name of the contact to be added | name of the contact |
email of the contact to be added | email of the contact | |
format | Output format should be as specified by this variable | XML/PHP/JSON/JSONP. Default response will be in JSON |
action | Flag to specify the action | add/delete. . Add action is Default |
Note: If you want to use 'Delete' functionality for deleting any contact, then simply use 'delete' value within 'action' parameter.
Example Responses
JSON
{
"status": "OK",
"code": 200,
"message": "Number updated Successfully"
}
Error Response:
{
"status": "ERROR",
"code": "A424",
"message": "Group Name does not exist!"
}
API Error Codes
Status | Message |
---|---|
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 |
Response Data
status | It indicates the success or failure of your request. |
Code | Error code |
message | It indicates the success or failure message. |