Messages

Retrieve outbound messages

Outbound messages are messages that are scheduled or were previously sent. This endpoint returns outbound messages sorted by increasing scheduled send time. Messages pending approval, including those created by and/or actionable by the given user, will also be returned via this API.

Messages returned can be filtered by social profile or the current state of the message. If more than 50 results are returned a cursor will be automatically created to paginate the results.

Query Parameters must be URL encoded. For example:

?startTime=2020-01-01T00%3A00%3A00Z
&endTime=2020-01-15T17%3A55%3A01Z
&socialProfileIds=1234
&state=SCHEDULED
&limit=5

To specify multiple social profiles, use the following syntax:

?socialProfileIds=1234&socialProfileIds=5678
get/v1/messages

Request

  • Base URL
    https://platform.hootsuite.com
  • URL
    https://platform.hootsuite.com/v1/messages
  • Auth
    OAuth 2
    Authorization code: https://platform.hootsuite.com/oauth2/auth
    Token URL: https://platform.hootsuite.com/oauth2/token

Query parameters

startTimestring required

The start date range of messages to be returned. In ISO-8601 format.

endTimestring required

The end date range of messages to be returned. In ISO-8601 format. Must not be later than 4 weeks from startTime.

statestring

A filter to return messages with in the matching state. Allowed values are PENDING_APPROVAL, REJECTED, SENT, SCHEDULED and SEND_FAILED_PERMANENTLY.

socialProfileIdsinteger

A filter to return messages for certain social profiles.

limitinteger

Maximum number of messages to be returned in the response. Defaults to 50 if not specified. Maximum allowable limit is 100.

cursorstring

Cursor to a specific page in the result set. Defaults to the first page.

includeUnscheduledReviewMsgsboolean

Flag to retrieve unscheduled (Send Now) review messages on top of scheduled ones retrieved from time range query.

Headers

Authorizationstring required

A bearer token string used for authentication

Response

Success

Example response

{
  "data": [
    {
      "id": "4138476039",
      "state": "SCHEDULED",
      "text": "5 trends that will change how we use social media this year http://owl.li/YuNr2",
      "socialProfile": {
        "id": "115185509",
        "externalURL": "https://www.linkedin.com/in/l-lhs-8654321"
      },
      "scheduledSendTime": "2018-10-25T10:35:00.000Z",
      "webhookUrls": [
        "https://myserver.com/inbound"
      ],
      "tags": [
        "test_tag"
      ],
      "targeting": {
        "facebookPage": {
          "ageMin": 45,
          "education": [
            "collegeGrad"
          ],
          "interestedIn": [
            "female"
          ],
          "relationshipStatus": [
            "single"
          ],
          "countries": [
            {
              "k": "Canada",
              "v": "CA"
            }
          ],
          "regions": [
            {
              "k": "British Columbia",
              "v": "2"
            }
          ],
          "cities": [
            {
              "k": "Burnaby, BC",
              "v": "292466"
            }
          ],
          "zips": [
            {
              "k": "K1S",
              "v": "CA:K1S"
            }
          ]
        },
        "linkedInCompany": {
          "companySize": [
            "51-200"
          ],
          "geography": [
            "as.jp"
          ],
          "industry": [
            "41"
          ],
          "jobFunction": [
            "qa"
          ],
          "seniority": [
            "en"
          ]
        }
      },
      "privacy": {
        "facebook": {
          "visibility": [
            "everyone"
          ]
        },
        "linkedIn": {
          "visibility": [
            "anyone"
          ]
        }
      },
      "location": {
        "latitude": 57.64911,
        "longitude": 10.40744
      },
      "emailNotification": true,
      "mediaUrls": [
        {
          "thumbnailUrl": "http://static.ow.ly/photos/thumb/cS5.jpg",
          "url": "http://static.ow.ly/photos/normal/cS5.jpg"
        }
      ],
      "media": [
        {
          "id": "aHR0cDovL2V4YW1wbGUub3Jn",
          "thumbnailId": "aHR0cDovL2V4YW1wbGUtMDAwMS5vcmc=",
          "videoOptions": {
            "facebook": {
              "title": "My Video",
              "category": "ENTERTAINMENT"
            }
          }
        }
      ],
      "extendedInfo": [
        {
          "socialProfileType": "PINTEREST",
          "socialProfileId": "123456789",
          "data": {
            "boardId": "123456789012345678",
            "destinationUrl": "https://www.hootsuite.com"
          }
        }
      ],
      "postId": "705207140236001282",
      "postUrl": "https://www.facebook.com/177463958820/posts/10155617296368821",
      "createdByMember": {
        "id": "1389211223"
      },
      "lastUpdatedByMember": {
        "id": "1389211222"
      },
      "sequenceNumber": 3,
      "reviewers": [
        {
          "type": "MESSAGE_LEVEL"
        }
      ]
    }
  ],
  "metadata": {
    "cursor": {
      "next": "1577887200000:4138476039:0",
      "previous": "1577887200000:4138476039:1"
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.