Publishing
Campaigns
The campaigns endpoint can be used to read, create, update and delete Oktopost campaigns.
Get Campaign
Get a single campaign by Id.
Parameters
| Param | Default | Description |
|---|---|---|
| withTags | 0 | Includes the campaign tags in the response. |
Example Request
curl -i https://api.oktopost.com/v2/campaign/002000000000000?withTags=1Example Result
{
"Result":true,
"Campaign": {
"Id":"002000000000000",
"Created":"2015-09-24 22:11:36",
"Modified":"2015-09-24 22:11:40",
"Name":"Oktopost Rocks",
"Status":"active",
"AccountId":"001000000000000",
"CreatedBy":"00A000000000000",
"ModifiedBy":"00A000000000000",
"Url":"",
"Color":"#de8736",
"ShortUrl":"",
"StartDate":"0000-00-00 00:00:00",
"EndDate":"0000-00-00 00:00:00",
"LastConversionDate":"0000-00-00 00:00:00",
"LastCommentFound":"0000-00-00 00:00:00",
"SendSummary":"",
"Clicks":0,
"ChildClicks":0,
"BoardClicks":0,
"Converts":0,
"ChildConverts":0,
"BoardConverts":0,
"Comments":0,
"NewComments":0,
"Likes":0,
"TotalMessages":0,
"TotalPosts":0,
"TotalPendingPosts":0,
"TotalDraftPosts":0,
"SFDCCampaignId":"701b0000000NOhlAAG",
"SFDCCampaignName":"Oktopost: Hello",
"SFDCCampaignOption":"account-campaign-only",
"Utm":"",
"Tags":
[
"pr",
"smms"
]
}
}List Campaigns
Get all campaigns.
Parameters
| Param | Default | Description |
|---|---|---|
| q | - | Filters by search term. |
| status | - | Filters by the campaigns' status. Options: active, complete, paused, or archived. |
| withTags | 0 | Includes the campaign tags in the response. |
Example Request
curl -i https://api.oktopost.com/v2/campaignExample Result
{
"Result":true,
"Items":[
{
"Id":"002000000000000",
"Name":"Hello World",
"TotalPosts":0,
"TotalPendingPosts":0,
"TotalDraftPosts":0,
"Clicks":0,
"Converts":0,
"Created":"2015-09-24 22:11:36",
"Status":"active",
"Comments":0,
"PostsSent":0
},
...
],
"Total":193
}Create Campaign
Parameters
| Param | Description |
|---|---|
| name | The campaign name. |
| url | Optional. The campaign URL. It allows users to insert a URL more quickly when creating posts. |
| tagIds | Optional. A comma separated list of tag Ids. Campaign tags apply to all messages in the campaign unless the user changes them. |
Example Request
curl -i https://api.oktopost.com/v2/campaign -X POST \
-d name="Oktopost Rocks" \
-d url="https://www.oktopost.com" \
-d tagIds=0AF000000000001,0AF000000000002Example Result
{
"Result": true,
"Campaign": {...}
}Update Campaign
When updating a campaign, all parameters become optional, and you have another option to set the campaign status as described below.
| Status | Description |
|---|---|
| active | The campaign is active and visible to users. |
| paused | The campaign is visible to users, but scheduled posts in this campaign won't go out. |
| archived | The campaign is archived and all scheduled posts are deleted. |
Example Request
curl -i https://api.oktopost.com/v2/campaign/002hdrn7bv1iogb -X POST \
-d name="Oktopost Rocks Again" \
-d url="https://www.oktopost.com/tour/social-media-publishing" \
-d status="active" \
-d tagIds=0AF000000000001,0AF000000000002Example Result
{
"Result": true,
"Campaign": {...}
}Delete Campaign
Example Request
curl -i https://api.oktopost.com/v2/campaign/00243ZdmqL9gwkM -X DELETE