Messages
Create and manage reusable content templates that can be scheduled as posts across your social networks.
A message is a reusable content template that includes text, links, and media attachments. Messages serve as the foundation for social media posts—each message can be scheduled multiple times across different social profiles and dates. Use these endpoints to create content templates, manage your message library, and prepare content for scheduling.
A single message can be used to create multiple posts, making it easy to share the same content across different profiles or time periods.
Get Message
Get data for a single message by Id.
Parameters
| Param | Default | Description |
|---|---|---|
| withTags | 0 | Includes the message tags in the response. |
Example Request
curl -i https://api.oktopost.com/v2/message/005000000000000?withTags=1Example Result
{
"Result":true,
"Message":{
"Id":"005000000000000",
"Created":"2015-09-17 15:04:57",
"Modified":"2015-09-17 15:04:57",
"Status":"default",
"AccountId":"001000000000000",
"CreatedBy":"00A000000000000",
"ModifiedBy":"00A000000000000",
"CampaignId":"002000000000000",
"Network":"Twitter",
"Subject":"",
"Message":"Using Animated GIFs on Twitter http:\/\/www.oktopost.com\/blog\/using-animated-gifs-twitter\/",
"Md5":"4aeb3671d71f96f3b9bc3b056f41d6ab",
"ImageUrl":"",
"Description":"",
"LinkTitle":"",
"LinkUrl":"",
"Url":"",
"Clicks":1,
"ChildClicks":0,
"BoardClicks":0,
"Converts":1,
"ChildConverts":0,
"BoardConverts":0,
"ChildrenCount":0,
"Picture":"1",
"IsBoardMessage":0,
"Media":[
{
"Id":"026000000000000",
"Created":"2015-09-17 15:04:56",
"Modified":"2015-09-17 15:04:57",
"AccountId":"001000000000000",
"Status":"valid",
"CreatedBy":"00A000000000000",
"ModifiedBy":"00A000000000000",
"Type":"Image",
"Size":190625,
"Resource":"https:\/\/s3.amazonaws.com\/com-oktopost-app-message-pictures\/afbeb62d-64fe-4bcd-aea7-1fa1bf42e88a\/TwitGif_L.gif",
"Name":"TwitGif_L.gif",
"Description":""
}
],
"Tags":
[
"pr",
"smms"
]
}
}List Messages
List all messages in a single campaign.
Parameters
| Param | Default | Description |
|---|---|---|
| campaignId | - | Mandatory field if not provided ids. The Oktopost campaign Id. |
| withTags | 0 | Includes the message tags in the response. |
| network | - | Filters by the social network: Twitter, LinkedIn, Facebook, Instagram, YouTube, WeChat, or Xing. |
| ids | - | Mandatory field if not provided campaignId. Coma separated list of Oktopost message ids, max 100. |
Example Result
{
"Result":true,
"Items":[
{
"Id":"005000000000000",
"Created":"2015-09-17 15:04:57",
"Modified":"2015-09-17 15:04:57",
"Status":"default",
"AccountId":"001000000000000",
"CreatedBy":"00A000000000000",
"ModifiedBy":"00A000000000000",
"CampaignId":"002000000000000",
"Network":"Twitter",
"Subject":"",
"Message":"Using Animated GIFs on Twitter http:\/\/www.oktopost.com\/blog\/using-animated-gifs-twitter\/",
"Md5":"4aeb3671d71f96f3b9bc3b056f41d6ab",
"ImageUrl":"",
"Description":"",
"LinkTitle":"",
"LinkUrl":"",
"Url":"",
"Clicks":1,
"ChildClicks":0,
"BoardClicks":0,
"Converts":1,
"ChildConverts":0,
"BoardConverts":0,
"ChildrenCount":0,
"Picture":"1",
"IsBoardMessage":0
}
],
"Total":1
}Example Request
curl -i https://api.oktopost.com/v2/message?campaignId=002000000000000Create Message
Create a new message asset. Each message can have either a link attachment or a media assets attached. Media assets can be created using the Media endpoint.
Parameters
| Param | Description |
|---|---|
| network | Facebook, Twitter, LinkedIn, Youtube, or Instagram. |
| campaignId | The campaign Id for the message. |
| message | The messages' content. |
| linkUrl | Optional. See Link Attachment Fields below. |
| linkTitle | Optional. See Link Attachment Fields below. |
| description | Optional. See Link Attachment Fields below. |
| imageUrl | Optional. See Link Attachment Fields below. |
| tagIds | Optional. A list of comma separated tag Ids. If empty, the message will inherit tags from the campaign. |
| media | Optional. The media attachment Id. |
| title | Optional. The title for YouTube videos. |
Example Requests
Create a message with a link attachment.
curl -i https://api.oktopost.com/v2/message -X POST \
-d network=Facebook \
-d campaignId=002000000000000 \
-d linkUrl="https://www.oktopost.com" \
-d linkTitle="Social Media Management for B2B" \
-d description="Oktopost is a social media management software designed to publish social messages, converse with prospects and generate leads" \
-d imageUrl="https://www.oktopost.com/assets/img/oktopost-og.png" \
-d message="Oktopost Rocks" \
-d tagIds=0AF000000000001,0AF000000000002Create a message with a media attachment.
curl -i https://api.oktopost.com/v2/message -X POST \
-d network=Facebook \
-d campaignId=00250yY80DW7Fz3 \
-d message="Oktopost Rocks" \
-d media=026e5kltqedafpeCreate a message for YouTube.
curl -i https://api.oktopost.com/v2/message -X POST \
-d network=Youtube \
-d campaignId=00250yY80DW7Fz3 \
-d message="YouTube video description" \
-d media="026e5kltqedafpe" \
-d title="YouTube video title"Link Attachments
To create or update link attachments the following 4 fields are mandatory.
| Field | Description |
|---|---|
| LinkUrl | Link attachment Url |
| ImageUrl | Link attachment image Url |
| LinkTitle | Link attachment title |
| Description | Link attachment description |
Media Limits
The following limits are for the amount of Media assets that can be attached for a single message.
| Network | Limit |
|---|---|
| 4 | |
| 18 | |
| 10 | |
| 9 |
Update Message
Update a single message by Id.
Example Request
curl -i https://api.oktopost.com/v2/message/005000000000000 -X POST \
-d message="Hello World"
-d linkUrl="https://www.oktopost.com" \
-d linkTitle="Social Media Management for B2B" \
-d description="Oktopost is a social media management software designed to publish social messages, converse with prospects and generate leads" \
-d imageUrl="https://www.oktopost.com/assets/img/oktopost-og.png" \On success, both create and update actions will return a similar response to the GET endpoint.
Delete Message
Example Request
curl -i https://api.oktopost.com/v2/message/005000000000000 -X DELETE