Oktopost
Publishing

Campaigns

Get, list, create, update, and delete Oktopost campaigns.

Get Campaign

Retrieve a single campaign by ID.

GET /v2/campaign/:campaignId

Parameters

Prop

Type

Example Request

curl -X GET "https://api.oktopost.com/v2/campaign/002000000000001?withTags=1" \
  -u ACCOUNT_ID:API_KEY

Example Response

{
    "Result": true,
    "Campaign": {
        "Id": "002000000000001",
        "Created": "2015-09-24 22:11:36",
        "Modified": "2015-09-24 22:11:40",
        "Name": "Oktopost Rocks",
        "Status": "active",
        "AccountId": "001000000000001",
        "CreatedBy": "00A000000000001",
        "ModifiedBy": "00A000000000001",
        "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

Retrieve all campaigns.

GET /v2/campaign

Parameters

Prop

Type

See Pagination for shared behavior.

Example Request

curl -X GET "https://api.oktopost.com/v2/campaign?_order=name,1&_count=50&_page=0" \
  -u ACCOUNT_ID:API_KEY

Example Response

{
    "Result": true,
    "Items": [
        {
            "Id": "002000000000001",
            "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

Create a campaign.

POST /v2/campaign

Parameters

Prop

Type

Example Request

curl -X POST "https://api.oktopost.com/v2/campaign" \
  -u ACCOUNT_ID:API_KEY \
  -d name="Oktopost Rocks" \
  -d url="https://www.oktopost.com" \
  -d tagIds=0AF000000000001,0AF000000000002

Example Response

{
    "Result": true,
    "Campaign": {...}
}

Update Campaign

Update a campaign's name, URL, tags, or status.

POST /v2/campaign/:campaignId

When updating a campaign, all parameters are optional, and you can also set the campaign status.

Parameters

Prop

Type

Example Request

curl -X POST "https://api.oktopost.com/v2/campaign/002000000000001" \
  -u ACCOUNT_ID:API_KEY \
  -d name="Oktopost Rocks Again" \
  -d url="https://www.oktopost.com/tour/social-media-publishing" \
  -d status="active" \
  -d tagIds=0AF000000000001,0AF000000000002

Example Response

{
    "Result": true,
    "Campaign": {...}
}

Delete Campaign

Delete a campaign.

DELETE /v2/campaign/:campaignId

Parameters

Prop

Type

Example Request

curl -X DELETE "https://api.oktopost.com/v2/campaign/002000000000001" \
  -u ACCOUNT_ID:API_KEY