GET /messaging/v1/sms/definitions

The number of records returned by this function is based on the $pageSize and $page parameters. It doesn’t necessarily return all the records in one call.

Note

Overview 

Get a list of SMS send definitions.

URL Parameters 

NameTypeDescription
$filterstringFilter by status type. Accepted values are active, inactive, or deleted. Valid operations are eq and neq.
$pageSizeintegerIn the array called definitions, each element is an object representing a send definition. This parameter controls the number of such objects that are returned per page.
$pageintegerPage number to return.
$orderBystringSort by a dimension. You can sort by only one dimension. Accepted values are definitionKey, name, createdDate, modifiedDate, and status.

Responses 

StatusNameTypeDescription
200  Success
 requestIdstringThe unique identifier of this request.
 namestringName of the definition.
 definitionKeystringUnique, user-generated key to access the definition object.
 statusstringOperational state of the definition: active, inactive, or deleted. A message sent to an active definition is processed and delivered. A message sent to an inactive definition isn’t processed or delivered. Instead, the message is queued for later processing for up to three days.
 createdDatestringDate the definition was created.
 modifiedDatestringDate and time of the most recent definition change.

Usage 

Example Request 

1Host: https://YOUR_SUBDOMAIN.rest.marketingcloudapis.com
2GET /messaging/v1/sms/definitions/?$filter=status%20eq%20active&$pageSize=10&$page=1&$orderBy=name
3Content-Type: application/json
4Authorization: Bearer YOUR_ACCESS_TOKEN

Example Response 

1HTTP/1.1 200 OK
2{
3  "requestId": "ba9633fa-5c8d-4c42-8efa-a16412ac0c53",
4  "definitions": [
5    {
6      "definitionKey": "account-reset",
7      "status": "Active",
8      "name": "Using new SMS Transactional API",
9      "createdDate": "2018-07-18T19:52:00",
10      "modifiedDate": "2018-07-18T19:52:00"
11    }
12  ],
13  "count": 1,
14  "page": 1,
15  "pageSize": 10
16}

HTTP Responses 

ResponseReason
200 OKSuccess. Review example response.
400 Bad RequestInvalid request
403 ForbiddenFailed to pass authorization.
500 Server ErrorInternal error

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!