The Create SMS Message command allows you to define message content to send via SMS. The command requires the following arguments: Command, Realm, Password, Message Name, and Message Text.
api_web?r=myrealm&p=mypass&c=createsmsmessage&message_name=My+SMS+Message&message_text=SMS+message+text
The command is ‘createsmsmessage', the realm is ‘myrealm’ and the password is ‘mypass’. The message named ‘My SMS Message’ contains the message ‘SMS Message Text’ .
Example
Using createsmsmessage with all commands and arguments (please note the command is wrapped for display purposes only):
api_web?r=myrealm&p=mypass&c=createsmsmessage&message_name=Welcome+Back&message_text=Welcome+back+to+our+list!&label=welcome
Successful results return, where ‘6’ is the ID of the new message:
SUCCESS: 6
Results
The Create SMS Message command outputs either a SUCCESS or FAILURE message.
Success
The command success message returns the SUCCESS message followed by the new message ID. The result format is:
SUCCESS: [message_id]
Failure
The command will fail for several reasons, including if a message with the same name already exists, name is missing, label does not exist, message name includes special characters, or the message is too long. The result format is:
FAILURE: [Reason]
Errors include:
FAILURE: Error label name not found (The message will still be created, but with no label)
FAILURE: Message text cannot be more than 160 characters long
FAILURE: Message text cannot be empty.
Arguments
The command supports the following arguments:
Name |
Req? |
Description |
Argument |
Command |
Yes |
Defines the command to use. |
cmd=createsmsmessage |
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] |
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] |
Message Name |
Yes |
Name of the SMS message to create. To include spaces, use + or %20 to avoid possible issues with spaces in a URL. |
message_name=[msg_name] |
Message Text |
Yes |
The message to send, limited to 160 characters. To include spaces, use + or %20 to avoid possible issues with spaces in a URL. |
message_text=[text] |
Labels |
Comma separated list of up to 10 labels, identifiers of custom keywords to group and report items that have a similar use or purpose. The label(s) must be defined for the Realm in order to save. |
label=[label_name(s)] |