Oktopost
Publishing

Links

Track and manage shortened links shared in your social media posts with Oktopost's link shortener.

Links are hyperlinks shared in your social media posts that are automatically shortened using Oktopost's okt.to link shortener. Each shortened link includes tracking capabilities that capture click data and referrer information. Use these endpoints to retrieve link details, view click analytics, and manage your shortened URLs.

All links shared through Oktopost are automatically shortened with the okt.to domain, enabling comprehensive click tracking and attribution across all your social media posts.

Retrieve public information about a link by its hash.

GET /v2/link/:hash

LongUrl is the URL the user entered, and FinalUrl is the final destination of the redirect.

Parameters

Prop

Type

Example Request

curl -X GET "https://api.oktopost.com/v2/link/pEhsLi" \
  -u ACCOUNT_ID:API_KEY

Example Response

{
    "Link": {
        "Created": "2019-02-25 07:50:35",
        "Hash": "pEhsLi",
        "LongUrl": "https://www.oktopost.com",
        "FinalUrl": "https://www.oktopost.com?utm_campaign=2019-02+General+Campaign&utm_content=Oktopost-twitter&utm_source=twitter&utm_medium=social",
        "Params": {
            "utm_campaign": "2019-02 General Campaign",
            "utm_content": "Oktopost-twitter",
            "utm_medium": "social",
            "utm_source": "twitter"
        },
        "ShortUrl": "https://okt.to/pEhsLi"
    },
    "Result": true
}

Retrieve the account's links, sorted by creation date.

GET /v2/link

Parameters

Prop

Type

Example Request

curl -X GET "https://api.oktopost.com/v2/link" \
  -u ACCOUNT_ID:API_KEY

Example Response

{
    "Result": true,
    "Items": [
        {
            "Id": "008000000000001",
            "Created": "2015-10-20 00:24:02",
            "Modified": "2015-11-03 18:20:35",
            "AccountId": "001000000000001",
            "CampaignId": "002000000000001",
            "MessageId": "005000000000001",
            "PostId": "004000000000001",
            "PostlogId": "007000000000001",
            "Hash": "2y8p21",
            "LongUrl": "http:\/\/www.oktopost.com",
            "ShortUrl": "http:\/\/okt.to\/2y8p21",
            "Clicks": 112,
            "Converts": 4,
            "CredentialId": "003-001000000000001-12345678"
        }
    ],
    "Total": 1
}

Change the destination URL of a link.

POST /v2/link/:linkId

Parameters

Prop

Type

Example Request

curl -X POST "https://api.oktopost.com/v2/link/008000000000001" \
  -u ACCOUNT_ID:API_KEY \
  -d longUrl="https://www.oktopost.com/blog"

Example Response

{
    "Result": true,
    "Items": [
        {
            "Id": "008000000000001",
            "Created": "2015-10-20 00:24:02",
            "Modified": "2015-11-03 18:20:35",
            "AccountId": "001000000000001",
            "CampaignId": "002000000000001",
            "MessageId": "005000000000001",
            "PostId": "004000000000001",
            "PostlogId": "007000000000001",
            "Hash": "2y8p21",
            "LongUrl": "http:\/\/www.oktopost.com\/blog",
            "ShortUrl": "http:\/\/okt.to\/2y8p21",
            "Clicks": 112,
            "Converts": 4,
            "CredentialId": "003-001000000000001-12345678"
        }
    ],
    "Total": 1
}