The Get SMS Messages command allows you to return the body of all SMS messages for a Realm. The command returns the list id, name, text, total parts, created and updated date of each message. The command require the following arguments: Command, Realm, and Password.
api_web?r=myrealm&p=mypass&c=getsmsmessages
The command is ‘getmessages’, the realm is ‘myrealm’, the password is ‘mypass’.
Example
Using all command and arguments (please note the command is wrapped for display purposes only):
api_web?r=myrealm&p=mypass&c=getsmsmessages
Successful results return:
"Id","RealmId","Name","MessageText","TotalParts","CreatedDate","UpdatedDate"
"50","1","Emoticon Test","Hello 🚜🐍🐤🙊👌🐗☀️☔️ 😜👍😁","1","2017-09-07 06:33:06","2017-09-13 09:17:20"
"2","1","Alert","Your package is delayed.","1","2017-04-14 07:32:00","2017-08-23 11:18:38"
"4","1","Atlanta","Welcome to Atlanta","1","2017-04-24 14:38:40","2017-04-24 14:38:40"
"72","1","Russian Call","привет, пожалуйста, позвоните нам","1","2017-12-05 10:30:42","2017-12-05 10:37:59"
Results
The Get Messages command outputs either the results of the search or a FAILURE message.
SUCCESS
The Get Messages command does not explicitly return a Success code. Instead, it outputs the message data. Use the output_format argument to return the following data in an alternate format.
"Id","RealmId","Name","MessageText","TotalParts","CreatedDate","UpdatedDate"
FAILURE
A Get Messages command will fail for several reasons. The result format is:
FAILURE: [Reason]
Arguments
The Get Messages command supports the following arguments:
Name |
Req? |
Description |
Argument |
Command |
Yes |
Defines the command to use. |
cmd=[getsmsmessages] c=[getsmsmessages] |
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] |
Output Format |
|
To specify the format of the list output, use one of two arguments. If no argument is included, the default output is space-delimited plain text string, which may not include all data columns.
|
csv=1 or output_format=[csv,csv_tab, csv_pipe,xml] |
Header |
|
To define the data with a label, use the Header argument. This can only be used in conjunction with the output format, and does not affect XML. |
headers=[0,1] DEFAULT==0 |