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.
Get Link by Hash
Returns public information about links.
Example Request
curl -i https://api.oktopost.com/v2/link/pEhsLiExample Result
The LongUrl represents the URL entered by the user while the FinalUrl represents the final destination of the redirect.
{
"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
}List Links
Example Request
curl -i https://api.oktopost.com/v2/linkParameters
| Param | Description |
|---|---|
| hash | Optional |
| credentialIds | Optional. Comma separated credential Ids |
| ids | Optional. Comma separated link ids, max 100 |
Example Result
All items are sorted by creation date.
{
"Result":true,
"Items":[
{
"Id":"008000000000000",
"Created":"2015-10-20 00:24:02",
"Modified":"2015-11-03 18:20:35",
"AccountId":"001000000000000",
"CampaignId":"002000000000000",
"MessageId":"005000000000000",
"PostId":"004000000000000",
"PostlogId":"007000000000000",
"Hash":"2y8p21",
"LongUrl":"http:\/\/www.oktopost.com",
"ShortUrl":"http:\/\/okt.to\/2y8p21",
"Clicks":112,
"Converts":4,
"CredentialId":"003-001000000000000-12345678"
}
],
"Total":1
}Update Links
Example Request
curl -i https://api.oktopost.com/v2/link/008000000000000 -X POST \
-d longUrl="https://www.oktopost.com/blog"Example Result
{
"Result":true,
"Items":[
{
"Id":"008000000000000",
"Created":"2015-10-20 00:24:02",
"Modified":"2015-11-03 18:20:35",
"AccountId":"001000000000000",
"CampaignId":"002000000000000",
"MessageId":"005000000000000",
"PostId":"004000000000000",
"PostlogId":"007000000000000",
"Hash":"2y8p21",
"LongUrl":"http:\/\/www.oktopost.com\/blog",
"ShortUrl":"http:\/\/okt.to\/2y8p21",
"Clicks":112,
"Converts":4,
"CredentialId":"003-001000000000000-12345678"
}
],
"Total":1
}