List Messages

Return a list of messages.

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

Parameters:

Parameters can be sent in the URL querystring or as POST variables.

ParameterOptionsDescription
SortMessageID, PublishTime, SentSort the list by a field.
SortDirectionASC, DESCSort Ascending or Descending
ListIDAny existing ListIDReturn messages that were sent to a specific list.
ScheduleTypeS, RReturn only messages with this ScheduleType.
SentOne or more Sent status valuesReturn only messages with these Sent status values (for example, Sent=0,2).
LimitAny IntegerLimit the results to a certain number of records.
PageAny IntegerIf Limit is specified, return a certain page of results. The first set of results is page 1.
Stats1, 0Include statistical information about the message (MessagesSent, LinksClicked)

Example Request:

GET https://app.mojotxt.com/api/v1/+15555550100/messages/list?ListID=173&Stats=1

Example Result:

{
    "result": "success",
    "timestamp": 1793491200,
    "request": {
        "ListID": "173",
        "Stats": "1",
        "object": "messages",
        "verb": "list",
        "phone": "+15555550100"
    },
    "record_count": 2,
    "records": [
        {
            "MessageID": 706,
            "UserID": null,
            "ScheduleType": "S",
            "PublishTime": 1893456000,
            "SendAfter": null,
            "SendAfterUnit": null,
            "SendTime": null,
            "SendWeekday": null,
            "Type": "SMS",
            "Message": "Test Message",
            "URL": null,
            "Media": null,
            "Sent": 0,
            "StatusMessage": null,
            "Lists": [
                173,
                174
            ],
            "MessagesSent": 0,  /* Included because of */
            "LinksClicked": 0  /* Stats=1 parameter. */
        },
        {
            "MessageID": 704,
            "UserID": null,
            "ScheduleType": "R",
            "PublishTime": 1790062099,
            "SendAfter": 3,
            "SendAfterUnit": "day",
            "SendTime": null,
            "SendWeekday": null,
            "Type": "SMS",
            "Message": "Thanks for subscribing three days ago!",
            "URL": "https://example.com",
            "Media": null,
            "Sent": 1,
            "StatusMessage": null,
            "Lists": [
                173
            ],
            "MessagesSent": 2,
            "LinksClicked": 1
        }
    ]
}