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. |
| 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, Instagram, Youtube, TikTok, Threads, Bluesky, WeChat, Xing, or WhatsApp. |
| 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. Comma-separated tag IDs. On a new message, omit both tagIds and tags to inherit the campaign's tags. Sending tagIds replaces that set. An empty value clears the tags and does not inherit them. Unrecognized IDs are dropped and do not return 400. A list of only unrecognized IDs is an empty set, so the new message does not inherit campaign tags. Ignored when tags is present. |
| tags | Optional. Tag names, one per tags[] value (for example tags[]=Product Launch). A single tags=Acme, Inc. is one name and is not split on commas. Names may contain spaces, punctuation, and commas. Names are trimmed, blank entries are dropped, and exact duplicates are dropped. A name longer than 64 characters, or more than 100 names after that cleanup, returns 400. If tags is present, it is the tag set even when empty, and tagIds is ignored. An empty value clears the tags and does not inherit campaign tags. Sending both tags and tagIds as non-empty lists returns 400. |
| media | Optional. The media attachment Id. |
| title | Optional. The title for YouTube videos. |
When a new message is inserted, omitting both tags and tagIds inherits the campaign's tags. If the content matches an existing message, create updates that message instead: omitting both keeps its tags, and sending either parameter replaces them. Unknown names are created when the caller can create tags. Without that permission they are dropped, and the request still replaces the tag set, so a list of only unknown names clears it.
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 tag names.
curl -i https://api.oktopost.com/v2/message -X POST \
-d network=Facebook \
-d campaignId=002000000000000 \
-d message="Oktopost Rocks" \
-d tags[]="Product Launch" \
-d tags[]="Q4 Report"Create 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.
tags and tagIds use the same format as Create Message. Omit both to keep the message's current tags. Send either parameter to replace the full set, or send it empty to clear the tags. If tags is present, even when empty, it is the tag set and tagIds is ignored. Sending both as non-empty lists returns 400. A list of only unrecognized tag IDs is an empty set and clears the message's tags. Unknown names are created when the caller can create tags. Without that permission they are dropped, and the request still replaces the tag set, so a list of only unknown names clears it.
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, create and update return a body that matches Get Message, and Tags is always included. Get Message and List Messages include Tags only when withTags=1.
Delete Message
Example Request
curl -i https://api.oktopost.com/v2/message/005000000000000 -X DELETE