Add A Message

Add (send) a new message.

https://app.mojotxt.com/api/v1/{phone_number}/messages/add

Use the Type parameter to specify whether you are sending an SMS or MMS message (if omitted, the API will assume SMS).

The Message and Lists parameters are required. You can also specify the PublishTime (UNIX timestamp when the message will be sent) and the URL (to include a link). You can send parameters as part of the GET querystring, or as POST data. Fields not included with your request will be ignored. To set a field to NULL, send an empty value.

Upon success, the server will return the newly created object's MessageID in the response "created_id" response field.

Example SMS Request:

GET https://app.mojotxt.com/api/v1/+16147052760/messages/add?Type=SMS&Message=Test Message&Lists[]=173&Lists[]=174&PublishTime=1460129849&URL=http%3A%2F%2Fgoogle.com

-or-

POSThttps://app.mojotxt.com/api/v1/+16147052760/messages/add
DATA Type=SMS /* Sending an SMS */
Message=Test Message /* The message text to send. */
Lists[]=173 /* The list to send to. */
Lists[]=174 /* A second list to send to. */ ScheduleType=S /* Send at a specific date and time */
PublishTime=1460129849 /* The time the message should be sent. */ URL=http%3A%2F%2Fgoogle.com /* A link to add to the end of the message (URL Encoded). */

Example Result:

{
"result": "success",
"timestamp": 1460130175,
"request": {
"phone": "+16147052760",
"object": "messages",
"verb": "add",
"Type": "SMS",
"Message": "Test Message",
"Lists": [
"173",
"174"
],
"PublishTime": "1460129849",
"URL": "http:\/\/google.com"
},
"message": "The message was added successfully.",
"created_id": 708
}

Example MMS Request:

GET https://app.mojotxt.com/api/v1/+16147052760/messages/add?Type=MMS&Message=Test Message&Media=http%3A%2F%2Fme.com%2fimage.png&Lists[]=173&Lists[]=174&PublishTime=1460129849&URL=http%3A%2F%2Fgoogle.com

-or-

POSThttps://app.mojotxt.com/api/v1/+16147052760/messages/add
DATA Type=MMS /* Sending an MMS */
Message=Test Message /* The message text to send. */
Media=http%3A%2F%2Fme.com%2fimage.png /* URL of image attachment. */
Lists[]=173 /* The list to send to. */
Lists[]=174 /* A second list to send to. */
PublishTime=1460129849 /* The time the message should be sent. */ URL=http%3A%2F%2Fgoogle.com /* A link to add to the end of the message (URL Encoded). */

Example Result:

{
"result": "success",
"timestamp": 1460130175,
"request": {
"phone": "+16147052760",
"object": "messages",
"verb": "add",
"Type": "MMS",
"Message": "Test Message",
"Media": "http:\/\/me.com\/image.png"
"Lists": [
"173",
"174"
],
"PublishTime": "1460129849",
"URL": "http:\/\/google.com"
},
"message": "The message was added successfully.",
"created_id": 708
}