Postman v2 Guide
Go to Postman v2
  • Postman v2 API Docs
    • 🤖About Postman v2
      • Postman v2 SLOs
    • Postman v2 SMS API user documentation
    • 📶Service Status
    • ⏰Postman Guide latest updates
    • 🏋️Important dates
    • 🛒Useful Links
  • Postman v2 general user guide (MoP)
    • 🔐Logging into Postman v2
    • 📢Create Campaign
      • Message Preview
      • Language tab
      • Message content
      • Character count
    • 🪵Message Logs
    • Deleting campaigns
  • Postman v2 Admin Portal, for UI Users (MOP)
    • 📤Sending messages via the Admin Portal
  • Postman v2 Admin Portal for API users (MOP)
    • ⚙️Campaign Settings
    • 🖥️Sending Messages via Postman API
  • 🪪Sending SMSes using NRIC
  • Postman v2 admin portal, for UI users (Internal)
    • Internal SMS
    • Information for new Twilio users
    • Summary of Costs
    • How do I onboard Postman v2 Internal SMS
      • 1. Sender ID Registration
      • 2. Sign up for a Twilio account
      • 3. Set up your Twilio account
      • 4. Fill your Twilio credentials on Postman
        • What if I need to buy a phone number?
      • 5. Send a Test Message
  • General notes for API users
    • 🗒️Overview
    • Authentication
    • API Errors
    • Message Delivery Errors
    • Pagination
    • Rate Limits
  • Endpoints for API users
    • 📞Endpoints for API users
    • The message object
    • Single Send
    • Single Send - Retry
    • Retrieve Message
    • Batch Send
    • Batch Send - Retry
    • Retrieve Batch
    • Retrieve Campaign Message
  • SFTP
    • 📂SFTP Integration
    • 🗝️Generating SSH Keys
    • Connecting to the SFTP server
    • Sending messages via SFTP
    • Checking whether sending via SFTP is successful
  • Load Test
    • Load Test Booking Requirement
  • FAQ
    • ❓Postman v2 FAQ
      • General Q&A
      • Sending emails to users (Legacy Postman)
      • Access related inquiries
      • Platform access related inquiries
      • User Access
      • API keys generation and IP Address whitelisting
      • Delivery Report
      • Messaging
      • Message Statuses
      • Integration and configuration related inquiries
      • Delivery rate
      • File types
      • SFTP and other integration methods
    • 💻Postman v2 API FAQ
      • API keys generation
      • Campaign related inquiries
      • API related inquiries
      • IP Address related inquiries
    • 🗃️SFTP and Other integration methods
  • Legal
    • Terms & Condition
    • Privacy Policy
  • Call App
    • Terms & Condition
    • Privacy Policy
Powered by GitBook
On this page
Export as PDF
  1. Endpoints for API users

Retrieve Campaign Message

PreviousRetrieve BatchNextSFTP Integration

Last updated 3 months ago

We will be updating our response payload to include a creatorId field from 24 Feb 2025. Please read the last section to find out where the amendment is and update your own systems if necessary, before 24 Feb 2025.

Retrieves messages and their delivery statuses given a campaign ID, as well as information about the campaign template. Please refer to this table in on what each message status means.

Endpoint #7
GET /campaigns/:campaignId/messages

Supported Query Parameters

limit string (Mandatory)

You can specify the number of messages to return per page using the limit query parameter. The minimum value is 1, and the maximum value is 1000.

after string (Optional)

Find messages after the cursorId

before string (Optional)

Find messages before the cursorId

search string (Optional)

This supports searching by recipient phone number only. It is a substring match, eg. a "11" would match with "91122233"

[Now to 26 Jan 2025] Example response body

Response Body
{
    "data": [
        {
            "createdAt": "2024-05-16T17:04:09.071+08:00",
            "updatedAt": "2024-05-16T17:05:39.704+08:00",
            "id": "<YOUR_MESSAGE_ID>",
            "recipient": "6511112222",
            "values": {
                "otp": "123456",
                "name": "tom"
            },
            "fullMessage": "This is a test message used for training purposes.\n\nOpen Government Products\n\n---\n\nDear tom, here is your 123456.\n\n---\n\nThis is an automated message sent by the Singapore Government.",
            "latestStatus": "failure",
            "templateBodyId": "<YOUR_TEMPLATE_BODY_ID>",
            "campaignId": "<YOUR_CAMPAIGN_ID>",
            "templateBody": {
                "createdAt": "2024-05-16T16:55:30.736+08:00",
                "updatedAt": "2024-05-16T16:55:30.736+08:00",
                "id": "<YOUR_TEMPLATE_BODY_ID>",
                "templateId": "<YOUR_TEMPLATE_ID>",
                "language": "english",
                "body": "Dear {{name}}, here is your {{otp}}.",
                "creatorId": "<YOUR_CREATOR_ID>"
            },
            "batches": [
                {
                    "createdAt": "2024-05-16T17:02:59.467+08:00",
                    "updatedAt": "2024-05-16T17:05:09.690+08:00",
                    "id": "<YOUR_BATCH_ID>",
                    "originalFileName": "(sample) API Test.csv",
                    "status": "messages_enqueued",
                    "campaignId": "<YOUR_CAMPAIGN_ID>",
                    "creatorId": "<YOUR_CREATOR_ID>",
                    "totalMessages": 3,
                    "BatchMessage": {
                        "createdAt": "2024-05-16T17:04:09.079+08:00",
                        "updatedAt": "2024-05-16T17:04:09.079+08:00",
                        "id": "30234",
                        "batchId": "<YOUR_BATCH_ID>",
                        "messageId": "<YOUR_MESSAGE_ID>",
                    }
                }
            ],
            "messageAttempts": [
                {
                    "sentAt": "2024-05-16T17:05:39.702+08:00",
                    "deliveredAt": null,
                    "createdAt": "2024-05-16T17:04:09.092+08:00",
                    "updatedAt": "2024-05-16T17:05:39.702+08:00",
                    "id": "<YOUR_MESSAGE_ATTEMPT_ID>",
                    "messageId": "<YOUR_MESSAGE_ID>",
                    "externalAttemptId": "",
                    "status": "failure",
                    "errorType": "delivery_error",
                    "errorCode": "recipient_unavailable",
                    "metadata": {},
                    "creatorId": "<YOUR_CREATOR_ID>",
                    "creator": {
                        "email": "<YOUR_GENERATED_CAMPAIGN_EMAIL>"
                    }
                }
            ],
            "language": "english",
            "batchId": "<YOUR_BATCH_EMAIL>",
            "creatorEmail": "<YOUR_CREATOR_ID>"
            "numAttempts": 1
        },
        {
            "createdAt": "2024-05-16T17:04:09.071+08:00",
            "updatedAt": "2024-05-16T17:05:09.746+08:00",
            "id": "<YOUR_MESSAGE_ID>",
            "recipient": "6522222222",
            "values": {
                "otp": "123456",
                "name": "mary"
            },
            "fullMessage": "This is a test message used for training purposes.\n\nOpen Government Products\n\n---\n\nDear mary, here is your 123456.\n\n---\n\nThis is an automated message sent by the Singapore Government.",
            "latestStatus": "failure",
            "templateBodyId": "<YOUR_TEMPLATE_BODY_ID>",
            "campaignId": "<YOUR_CAMPAIGN_ID>",
            "templateBody": {
                "createdAt": "2024-05-16T16:55:30.736+08:00",
                "updatedAt": "2024-05-16T16:55:30.736+08:00",
                "id": "<YOUR_TEMPLATE_BODY_ID>",
                "templateId": "<YOUR_TEMPLATE_ID>",
                "language": "english",
                "body": "Dear {{name}}, here is your {{otp}}.",
                "creatorId": "<YOUR_CREATOR_ID>"
            },
            "batches": [
                {
                    "createdAt": "2024-05-16T17:02:59.467+08:00",
                    "updatedAt": "2024-05-16T17:05:09.690+08:00",
                    "id": "<YOUR_BATCH_EMAIL>",
                    "originalFileName": "(sample) API Test.csv",
                    "status": "messages_enqueued",
                    "campaignId": "<YOUR_CAMPAIGN_ID>",
                    "creatorId": "<YOUR_CREATOR_ID>",
                    "totalMessages": 3,
                    "BatchMessage": {
                        "createdAt": "2024-05-16T17:04:09.079+08:00",
                        "updatedAt": "2024-05-16T17:04:09.079+08:00",
                        "id": "30235",
                        "batchId": "<YOUR_BATCH_ID>",
                        "messageId": "<YOUR_MESSAGE_ID>"
                    }
                }
            ],
            "messageAttempts": [
                {
                    "sentAt": "2024-05-16T17:05:09.743+08:00",
                    "deliveredAt": null,
                    "createdAt": "2024-05-16T17:04:09.092+08:00",
                    "updatedAt": "2024-05-16T17:05:09.743+08:00",
                    "id": "<YOUR_MESSAGE_ATTEMPT_ID>",
                    "messageId": "<YOUR_MESSAGE_ID>",
                    "externalAttemptId": "",
                    "status": "failure",
                    "errorType": "server_error",
                    "errorCode": "server_unknown_error",
                    "metadata": {},
                    "creatorId": "<YOUR_CREATOR_ID>",
                    "creator": {
                        "email": "<YOUR_CREATOR_EMAIL>"
                    }
                }
            ],
            "language": "english",
            "batchId": "<YOUR_BATCH_EMAIL>",
            "creatorEmail": "<YOUR_CREATOR_ID>",
            "numAttempts": 1
        },
        {
            "createdAt": "2024-05-16T17:04:09.071+08:00",
            "updatedAt": "2024-05-16T17:04:09.071+08:00",
            "id": "message_6e4fedf2-9377-50ef-8457-81cb1f1c8831",
            "recipient": "6599999999",
            "values": {
                "otp": "123456",
                "name": "john"
            },
            "fullMessage": "This is a test message used for training purposes.\n\nOpen Government Products\n\n---\n\nDear john, here is your 123456.\n\n---\n\nThis is an automated message sent by the Singapore Government.",
            "latestStatus": "created",
            "templateBodyId": "<YOUR_TEMPLATE_BODY_ID>",
            "campaignId": "<YOUR_CAMPAIGN_ID>",
            "templateBody": {
                "createdAt": "2024-05-16T16:55:30.736+08:00",
                "updatedAt": "2024-05-16T16:55:30.736+08:00",
                "id": "template-body_6df15c76-cbd4-4c5b-ac8b-c66fefaf634a",
                "templateId": "template_738af768-8050-41d6-8bc5-2a140b5b67df",
                "language": "english",
                "body": "Dear {{name}}, here is your {{otp}}.",
                "creatorId": "<YOUR_CREATOR_ID>"
            },
            "batches": [
                {
                    "createdAt": "2024-05-16T17:02:59.467+08:00",
                    "updatedAt": "2024-05-16T17:05:09.690+08:00",
                    "id": "batch_f1896233-7f4e-4162-bdd5-888fcf5e85c9",
                    "originalFileName": "(sample) API Test.csv",
                    "status": "messages_enqueued",
                    "campaignId": "<YOUR_CAMPAIGN_ID>",
                    "creatorId": "<YOUR_CREATOR_ID>",
                    "totalMessages": 3,
                    "BatchMessage": {
                        "createdAt": "2024-05-16T17:04:09.079+08:00",
                        "updatedAt": "2024-05-16T17:04:09.079+08:00",
                        "id": "30233",
                        "batchId": "<YOUR_BATCH_ID>",
                        "messageId": "<YOUR_MESSAGE_ID>"
                    }
                }
            ],
            "messageAttempts": [
                {
                    "sentAt": "2024-05-16T17:05:39.757+08:00",
                    "deliveredAt": null,
                    "createdAt": "2024-05-16T17:04:09.092+08:00",
                    "updatedAt": "2024-05-16T17:05:39.757+08:00",
                    "id": "<YOUR_MESSAGE_ATTEMPT_ID>",
                    "messageId": "<YOUR_MESSAGE_ID>",
                    "externalAttemptId": "<YOUR_EXTERNAL_ATTEMPT_ID>",
                    "status": "sent",
                    "errorType": null,
                    "errorCode": null,
                    "metadata": {},
                    "creatorId": "<YOUR_CREATORN_ID>",
                    "creator": {
                        "email": "<YOUR_GENERATED_CAMPAIGN_EMAIL>"
                    }
                }
            ],
            "language": "english",
            "batchId": "batch_f1896233-7f4e-4162-bdd5-888fcf5e85c9",
            "creatorEmail": "campaign_da25c9b7-7540-4ca4-aa4a-66d4d7ddcd7b@postman.gov.sg",
            "numAttempts": 1
        },
        {
            "createdAt": "2024-05-16T16:57:53.761+08:00",
            "updatedAt": "2024-05-16T16:58:06.526+08:00",
            "id": "<YOUR_MESSAGE_ID>",
            "recipient": "6599999999",
            "values": {
                "otp": "12345",
                "name": "John Doe"
            },
            "fullMessage": "This is a test message used for training purposes.\n\nOpen Government Products\n\n---\n\nDear John Doe, here is your 12345.\n\n---\n\nThis is an automated message sent by the Singapore Government.",
            "latestStatus": "success",
            "templateBodyId": "<YOUR_TEMPLATE_BODY_ID>",
            "campaignId": "<YOUR_CAMPAIGN_ID>",
            "templateBody": {
                "createdAt": "2024-05-16T16:55:30.736+08:00",
                "updatedAt": "2024-05-16T16:55:30.736+08:00",
                "id": "<YOUR_TEMPLATE_BODY_ID>",
                "templateId": "<YOUR_TEMPLATE_ID>",
                "language": "english",
                "body": "Dear {{name}}, here is your {{otp}}.",
                "creatorId": "<YOUR_CREATOR_ID>"
            },
            "batches": [],
            "messageAttempts": [
                {
                    "sentAt": "2024-05-16T16:57:53.908+08:00",
                    "deliveredAt": null,
                    "createdAt": "2024-05-16T16:57:53.763+08:00",
                    "updatedAt": "2024-05-16T16:58:06.525+08:00",
                    "id": "<YOUR_MESSAGE_ATTEMPT_ID>",
                    "messageId": "<YOUR_MESSAGE_ID>",
                    "externalAttemptId": "<YOUR_EXTERNAL_ATTEMPT_ID>",
                    "status": "success",
                    "errorType": null,
                    "errorCode": null,
                    "metadata": {},
                    "creatorId": "<YOUR_CREATOR_ID>",
                    "creator": {
                        "email": "<YOUR_CREATOR_EMAIL>"
                    }
                }
            ],
            "language": "english",
            "creatorEmail": "<YOUR_CREATOR_EMAIL>",
            "numAttempts": 1
        }
    ],
    "pageData": {
        "hasNextPage": false,
        "hasPreviousPage": false,
        "startCursor": "WyIyMDI0LTA1LTE2VDE3OjA0OjA5LjA3MSswODowMCIsIm1lc3NhZ2VfZTgxN2NjM2EtMTA0NC01ODYxLWJmZDUtMDMwM2IwYzczYjcxIl0=",
        "endCursor": "WyIyMDI0LTA1LTE2VDE2OjU3OjUzLjc2MSswODowMCIsIm1lc3NhZ2VfZDhiNWY5M2QtZDgyYi00NWRkLWIyZTctMWYxMTlmMjUwMTcyIl0="
    }
}

[From 24 Feb 2025] The creatorId field will be inserted in the response payload for each message object from 24 Feb 2025. In this above example it will be inserted once per message object i.e. total of 4 times. Please amend your own code accordingly for

"creatorId": "<USER_ID_OF_MESSAGE_CREATOR>"

Possible message statuses and what they mean