The Add SMS Contact to Sender Code command allows you to subscribe an existing SMS contact to an SMS Sender Code. The command requires the following arguments: Command, Realm, Password, Email, Phone Number, Country, and Sender Code.
api_web?r=myrealm&p=mypass&c=addsubscribertosendercode&email=jane.doe@mydomain.com&phone=12065551212&country=us&sender_code=120162701555
The command is ‘addsubscribertosendercode', the realm is ‘myrealm’ and the password is ‘mypass’. The SMS contact with the matching email will be added to the sender code '120162701555'.
Example
Using addsubscribertosendercode with all commands and arguments (please note the command is wrapped for display purposes only):
api_web?r=myrealm&p=mypass&c=addsubscribertosendercode&email=jane.doe@mydomain.com&first=Jane&phone=12065551212&country=us&sender_code=120162701555&group_name=mygroup
Successful results return:
SUCCESS: Adding subscriber to sender code was successful
Results
The Add Contact to Sender Code commands output either a SUCCESS or FAILURE message.
Success
The command success message returns the SUCCESS message. The result format is:
SUCCESS: Adding subscriber to sender code was successful
Failure
The command will fail if a subscription already exists, if the contact is not found, or if an argument is invalid. The result format is:
FAILURE: [Reason]
Arguments
The command supports the following arguments:
Name |
Req? |
Description |
Argument |
Command |
Yes |
Defines the command to use. |
cmd=addsubscribertosendercode c=addsubscribertosendercode |
Realm |
Yes |
Name of the realm to run the command. This is required, and the command will fail if the realm and password do not match. |
realm=[realm_name] r=[realm_name] |
Password |
Yes |
Authentication code for API access. This is required, and the command will fail if the realm and password do not match. |
pwd=[password] p=[password] |
|
Yes |
Email address of the Email Contact to subscribe. Contact must already exist. |
email=[email] |
Phone |
Yes |
Numeric phone number for the contact. Do not include special characters (such as parenthesis or dash). NOTE: The phone is not validated against any field of the Email Contact. |
phone=[phone] |
Country |
Yes |
Two letter country code for the Contact phone carrier. |
country=[country_code] |
Sender Code |
Yes |
Sender Code representing the message sender. A Sender Code is either a short code or number. It represents the 'from' field when deploying an SMS. The message recipient will see this sender on their mobile device when a message is received. |
sender_code=[sender_code] |
First Name |
|
First name of Email Contact to subscribe used in conjunction with Email. |
first=[first] |
Group Name |
SMS Group to associate Subscription for sending batch messages. |
group_name=[group_name] |