POST get

{{domainAddress}}/messages/get

Retrieves a list of messages that are to be displayed to the user upon receipt.

Revisions:

Headers

HeaderContent
Content Typeapplication/json
AuthorizationBearer {{ID token}}
App-Id{{API key provided by Mosaic}}
Device-Id{{Advertising ID from the initial installation of this app}}
Request-Date{{ISO 8601 date and time format in UTC}}

Body

Parameters
ParameterDescription
{{clientId}} Is provided by CWF for the app project and will be consistent throughout all API calls that require this ID. Type: String; Required
{{onlyUnread}}Including this propertion, and setting its value to true, will force the API to filter our messages that have already been read by the user, returning only unread messages.
Type: Boolean; Optional
{
    "clientId":"{{clientId}}",
    "onlyUnread":"{{unreadOnly}}"
}

Example

Headers
App-Id: 5***9-d**3-4**8-b**1-b3***dac
Device-Id: a4***cb-d***5-4***f-8***c-84***75
Request-Date: 2024-07-02T19:59:20.815Z
Content-Type: application/json
Authorization: Bearer eyJraWQiO...aLxlc6PCgQ
Body
{
    "clientId":"1f6w1jh6ls3mb",
    "onlyUnread":true
}

Response

The contents supplied within the result.data object will be required in order to proceed with other API functions.

{
    "errors": [],
    "warnings": [],
    "notices": [],
    "data": {
        "messages":[
            {
                "messageId": 7,   <-- number
                "clientId": "1f6w1jh6ls3mb",
                "userId": "03af191d-70d2-472e-9ac0-149cx2437f9d",
                "messageTitle": "Message title for popup",
                "messageContents": "Whatever needs to be said to the customer",
                "createdOn": 1584031135245,  <-- ignore
                "acknowledgedOn": 0,  <-- ignore
                "ctaData": {}  <-- ignore
            }
        ]
    }
}

Note: As-built response revision, above:

  • “id” property name changed to “messageId” and is now a Number, not a String.