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
Retrieve a single message by ID.
GET /v2/message/:messageId
Parameters
Prop
Type
Example Request
curl -X GET "https://api.oktopost.com/v2/message/005000000000001?withTags=1" \
-u ACCOUNT_ID:API_KEYExample Response
{
"Result": true,
"Message": {
"Id": "005000000000001",
"Created": "2015-09-17 15:04:57",
"Modified": "2015-09-17 15:04:57",
"Status": "default",
"AccountId": "001000000000001",
"CreatedBy": "00A000000000001",
"ModifiedBy": "00A000000000001",
"CampaignId": "002000000000001",
"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": "026000000000001",
"Created": "2015-09-17 15:04:56",
"Modified": "2015-09-17 15:04:57",
"AccountId": "001000000000001",
"Status": "valid",
"CreatedBy": "00A000000000001",
"ModifiedBy": "00A000000000001",
"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
Retrieve the messages in a campaign, or a set of messages by ID.
GET /v2/message
Parameters
Prop
Type
Example Request
curl -X GET "https://api.oktopost.com/v2/message?campaignId=002000000000001" \
-u ACCOUNT_ID:API_KEYExample Response
{
"Result": true,
"Items": [
{
"Id": "005000000000001",
"Created": "2015-09-17 15:04:57",
"Modified": "2015-09-17 15:04:57",
"Status": "default",
"AccountId": "001000000000001",
"CreatedBy": "00A000000000001",
"ModifiedBy": "00A000000000001",
"CampaignId": "002000000000001",
"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
}Create Message
Create a message.
POST /v2/message
Each message can have either a link attachment or media assets attached. Media assets can be created using the Media endpoint. On success, the response matches Get Message, and Tags is always included.
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.
Parameters
Prop
Type
Example Request
Create a message with a link attachment:
curl -X POST "https://api.oktopost.com/v2/message" \
-u ACCOUNT_ID:API_KEY \
-d network=Facebook \
-d campaignId=002000000000001 \
-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 -X POST "https://api.oktopost.com/v2/message" \
-u ACCOUNT_ID:API_KEY \
-d network=Facebook \
-d campaignId=002000000000001 \
-d message="Oktopost Rocks" \
-d tags[]="Product Launch" \
-d tags[]="Q4 Report"Create a message with a media attachment:
curl -X POST "https://api.oktopost.com/v2/message" \
-u ACCOUNT_ID:API_KEY \
-d network=Facebook \
-d campaignId=002000000000001 \
-d message="Oktopost Rocks" \
-d media=026000000000001Create a message for YouTube:
curl -X POST "https://api.oktopost.com/v2/message" \
-u ACCOUNT_ID:API_KEY \
-d network=Youtube \
-d campaignId=002000000000001 \
-d message="YouTube video description" \
-d media="026000000000001" \
-d title="YouTube video title"Link Attachments
To create or update a link attachment, all four of these fields are required.
Prop
Type
Media Limits
The maximum number of media assets that can be attached to a single message, by network.
Prop
Type
Update Message
Update a single message by ID.
POST /v2/message/:messageId
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.
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.
Parameters
Prop
Type
The body accepts the same parameters as Create Message.
Example Request
curl -X POST "https://api.oktopost.com/v2/message/005000000000001" \
-u ACCOUNT_ID:API_KEY \
-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"Delete Message
Delete a message.
DELETE /v2/message/:messageId
Parameters
Prop
Type
Example Request
curl -X DELETE "https://api.oktopost.com/v2/message/005000000000001" \
-u ACCOUNT_ID:API_KEY