Skip to main content

Scheduling Messages

This guide describes how to schedule messages using the REST API.

1. Retrieving a Social Profile​

Before scheduling your first message through the Hootsuite API, you'll need to know what social profile to schedule the message to. Use this socialProfiles endpoint.

You'll need to use a valid access_token to request the social profiles of the authenticated Hootsuite member.

Request
curl -H "Authorization: Bearer [USER_ACCESS_TOKEN]" \
-X GET https://platform.hootsuite.com/v1/socialProfiles
Response
{
"data": [
{
"id": "115185509",
"type": "FACEBOOK",
"socialNetworkId": "1261768027866378",
"socialNetworkUsername": "Pammy The Dog",
"avatarUrl": "https://scontent.xx.fbcdn.net/v/t1.0-1/c59.0.200.200/p300x500/10354686_10151114552801856_220324501106153455_n.jpg?oh=375abcd2474f9fe943242bfe9c313bc2&oe=590D5D25",
"owner": "MEMBER"
}
]
}

2. Scheduling a Message​

Messages can be scheduled for one or more social profiles retrieved from the previous request by passing the social profile ID as part of the request data. Use this scheduleMessage endpoint. *Note that the socialNetworkId is the ID used by the Social Networks themselves. Please ensure to include the social profile id returned.

When including Media in your message, you'll need to incorporate the Uploading & Attaching media into the scheduling workflow.

Request
curl -H "Authorization: Bearer [USER_ACCESS_TOKEN]" \
-X POST https://platform.hootsuite.com/v1/messages \
-d @- <<EOF
{
"text":"Scheduled via API",
"socialProfileIds": [118264228],
"scheduledSendTime": "2029-03-01T14:00:00Z",
"location": {"latitude":34.56, "longitude":-12.34},
"emailNotification":false
}
EOF
Response
{
"data": [
{
"id":"3681703710",
"state":"SCHEDULED",
"text":"Scheduled via API",
"scheduledSendTime":1519912800,
"socialProfile":{
"id":"115185509"
},
"mediaUrls":null,
"webhookUrls":null,
"tags":null,
"targeting":null,
"privacy":null,
"location":{
"latitude":34.56,
"longitude":-12.34
},
"emailNotification":false,
"postUrl":null
}
],
"errors":null
}

You’ve successfully scheduled a message! See the REST API Reference for more detailed documentation.

Troubleshooting

Scheduling Time:
The time the message is scheduled to be sent in UTC time, ISO-8601 format. Missing or different timezones will not be accepted, to ensure there is no ambiguity about scheduled time. Dates must end with 'Z' to be accepted. Scheduled send times must be set to at least 5 minutes into the future.