getMessages
Get all Messages in a paginated listing, sorted by ascending createdAt
.
Query Parameters
- page integer
Possible values:
>= 1
Default value:
1
The page number in a paginated listing.
- items integer
Possible values:
>= 1
and<= 20
Default value:
20
The number of items to return on each page.
- createdAfter RFC3339
Filter Messages to only include those with a
createdAt
timestamp strictly greater thancreatedAfter
. Useful for polling and batch processing; iterate over all Messages, and filter each request bycreatedAt
of the latest processed Message.Example: 2023-05-07T14:21:56.123Z - state string
Possible values: [
processed
,unprocessed
]Filter Messages to only include/exclude those with a
processedAt
timestamp. Useful for processing.Example: processed - external boolean
Possible values: [
true
,false
]Filter to only return
external
orinternal
MessagesExample: true
- 200
All messages in a paginated listing.
- application/json
- Schema
- Example (from schema)
Schema
messages object[]
Array [type string requiredPossible values: [
Message
]id string requireduser object required
type string requiredid string requiredexternalId stringtranslatedTitle object
[locale] stringtranslatedBody object required
[locale] stringimage object
src string requiredImage URL
translatedAlt object
[locale] stringheight integerHeight of the image in pixels.
width integerWidth of the image in pixels.
cta string requiredcreatedAt RFC3339 requiredprocessedAt RFC3339 requiredexternal boolean required]meta object
next_url urlURL for the next page.
count integerThe total count of items.
items integerThe number of returned items on this page.
pages integerThe number of pages.
from integerIndex of the first item on this page (starting from 1).
to integerIndex of the last item on this page.
{
"messages": [
{
"id": "11785037-908d-41f5-875c-ceea9fb5c2f5",
"type": "Message",
"user": {
"type": "User",
"id": "cb66889a-8a8b-4d6b-81a3-fcf2340e838a",
"externalId": "usr_12345"
},
"translatedTitle": {
"en": "Save more toward Electric Car"
},
"translatedBody": {
"en": "Save every day, week or month without having to think about it. Go to Impact Finance in the app to try automatic savehacks."
},
"image": {
"src": "https://assets.dreams.enterprises/rails/.../image.jpg",
"translatedAlt": {
"en": "Your Dream"
},
"height": 144,
"width": 144
},
"cta": "/dreams/de2706a8-6853-479a-9b61-ed9d1c91010d/marketplace",
"createdAt": "2023-05-07T14:21:56.123Z",
"processedAt": "2023-05-07T15:21:56.123Z",
"external": true
}
],
"meta": true
}