Posts

The following API endpoint allows to list, create, update and delete posts in Oktopost. Please note that all posts are available to read, however, creating, updating and deleting options are available only for posts that have not yet been sent.

Get Post

Example Request

curl -i https://api.oktopost.com/v2/post/004000000000000

Example Result

{  
    "Result":true,
    "Post":{  
        "Id":"004000000000000",
        "Created":"2015-12-07 23:47:30",
        "Modified":"2015-12-08 12:55:11",
        "Status":"inqueue",
        "AccountId":"001000000000000",
        "CreatedBy":"00A000000000000",
        "ModifiedBy":"00A000000000000",
        "Source":"API",
        "ContentSource":"User",
        "Queued":1,
        "CampaignId":"002000000000000",
        "MessageId":"005000000000000",
        "MessageChildId":"",
        "MessageStatus":"default",
        "Network":"Twitter",
        "StartDateTime":"2015-12-08 00:00:00",
        "Groups":"",
        "GroupsCount":0,
        "TotalCount":1,
        "TargetGeo":"",
        "UpdateStatus":1,
        "Flag":"discussion",
        "Clicks":0,
        "Converts":0,
        "Comments":0,
        "NewComments":0,
        "Likes":0,
        "Utm":"",
        "Credentials":"003-001000000000000-12345678"
	}
}

List Posts

Example Request

curl -i https://api.oktopost.com/v2/post?campaignId=002000000000000

Parameters

The following parameters can be used to filter requests. We strongly recommend using filtering and ordering to get the desired results.

Param Default Description
_page 0 The current page
_count 25 The number of results per page
_order created Options: created, startDateTime
messageId - See Message API
campaignId - See Campaign API
status - Post status, see post statuses below
createdBy - The Id of the Oktopost user who created the post
source - The channel the post created from, see sources below

Example Result

{  
    "Result":true,
    "Items":[  
        {  
            "Id":"004000000000000",
            "Created":"2015-12-07 23:47:30",
            "Modified":"2015-12-08 12:55:11",
            "Status":"inqueue",
            "AccountId":"001000000000000",
            "CreatedBy":"00A000000000000",
            "ModifiedBy":"00A000000000000",
            "Source":"API",
            "ContentSource":"User",
            "Queued":1,
            "CampaignId":"002000000000000",
            "MessageId":"005000000000000",
            "MessageChildId":"",
            "MessageStatus":"default",
            "Network":"Twitter",
            "StartDateTime":"2015-12-08 00:00:00",
            "Groups":"",
            "GroupsCount":0,
            "TotalCount":1,
            "TargetGeo":"",
            "UpdateStatus":1,
            "Flag":"discussion",
            "Clicks":0,
            "Converts":0,
            "Comments":0,
            "NewComments":0,
            "Likes":0,
            "Utm":"",
            "Credentials":"003-001000000000000-12345678"
        },
        ...
    ],
    "Total":22509
}

Create Post

Example Request

curl -i https://api.oktopost.com/v2/post -X POST \
-d messageId=005000000000000 \
-d credentialIds=003-001000000000000-12345678 \
-d startDateTime=1401908598

Parameters

Param Default Description
messageId - Required. The message Id
credentialIds - Required. Comma separated values of social profile Ids
startDateTime +1 minute Unix timestamp. Scheduled time for the post to go out
status pending Options: pending, inqueue, draft, inqueue-draft

Update Post

All parameters available on post creation can be updated as-well.

Example Request

curl -i https://api.oktopost.com/v1/post/004000000000000 -X POST \
-d startDateTime=1435767841 \
-d messageId=005000000000000

On success, both create and update actions will return a similar response to the GET endpoint.

Delete Post

Example Request

curl -i https://api.oktopost.com/v1/post/004000000000000 -X DELETE

Example Response

{  
    "Result":true
}

Proporties

Sources

Post sources represent the channel used to create each post. Sources are used in Oktopost to analyze performance by channel.

Source Description
UI Posts created using the Oktopost application
API Posts created using the API
Autoposter Posts created using the Autoposter
Bookmarklet Posts created using the bookmarklet or browser extension
Board Posts created using the Social Advocacy Board

Statuses

The following statuses represent the different states of each post. They can be used for filtering results or for creating and updating posts.

Status Description
pending Scheduled post
inqueue Queued post
inqueue-draft Draft post in queue
draft Draft post
complete Sent post
incomplete Sent with errors
error Has errors

Feedback and Knowledge Base