RocketCOMS

Search Messages

Search sent messages based on the message campaign, sent date, and status. Use the sort query parameter to sort the results, and use the page and size query parameters to limit the number of results returned.

Endpoint

GET /v1/messages

Authorization Header

Authorization: Bearer <access_token>
or
Authorization: Basic <encodedString>
where <encodedString> is your <api-key>:<api-secret> string encoded using Base64 encoding

Query Parameters

campaignId

string

ID of the campaign that sent the message.

batchId

string

ID of the batch file that contains the message.

from

string, format: YYYY-MM-DD

Date the message was sent. This filter will return messages sent on or after this date. Can be used in conjunction with to to specify a date range.

to

string, format: YYYY-MM-DD

Date the message was sent. This filter will return messages sent on or before this date. Can be used in conjunction with from to specify a date range.

status

string, values: PENDING, IN_PROCESS, CANCELED, SENT, DELIVERED, FAILED

Status code for the message.

singleOnly

boolean

Whether only single messages will be included in the response. Single messages are sent directly and are not part of a campaign batch file.

sortBy

string

Sort the response by any field.

sortDir

string, values: desc, asc

Sort direction.

page

integer (int32), default: 0

Page number to return.

pageSize

integer (int32)

Maximum number of results to return per page.

Request Body

None

Returns

Returns a paginated response with an array of Message objects.

SAMPLE RESPONSE

				
					{
  "status": "string",
  "result": {
    "content": [
      {
        "id": "ba68bc22-d512-4467-8a54-e92d8e8a9c53",
        "campaignId": "d7b0e25f-30c9-456b-b287-6b3dcaa4b8f7",
        "createdAt": "2022-04-24T01:51:03.419Z",
        "destinationNumber": "5555556789",
        "messageText": "Spring Sale Starts Today",
        "status": {
          "statusCode": "PENDING",
          "reasonText": "string",
          "updatedAt": "2022-04-25T01:30:02.419Z"
        }
      },
      {...},
      {...}
    ],
    "page": 0,
    "total": 100,
    "pageSize": 10
  }
}