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 a valid access_token to request the social profiles the authenticated Hootsuite member has access to.

curl -H "Authorization: Bearer [USER_ACCESS_TOKEN]" \
  -X GET https://platform.hootsuite.com/v1/socialProfiles
{
	"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. *Note that the socialNetworkId is the ID used by the Social Networks themselves. Please ensure to include the social profile id returned.

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
{
   "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
}

Warning

The request above creates a real scheduled message and will publish to the selected social profile at the specified time. You can delete this message from the Hootsuite Web Dashboard or using the Delete Message endpoint.

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