Authentication

Authenticates a user using api key. If authentication is successful, the API will return a json object with a token attribute. You must supply the token as a request header 'Authorization' attribute with the format: 'Bearer __token__' for API calls requiring authentication.
Headers
Name Type Required Description
Accept string Yes Must be application/json
Parameters
Name Type Required Description
api_key string Yes User's api key
Body
{
  "api_key": "key"
}
Headers
Parameters
Response

                                

                            
HTTP 200 OK

{
  "token": "eyJ0eXAi...KMxwwexXrY8GdU"
}

Urls

Get total number of clicks and links
Headers
Name Type Required Description
Accept string Yes Only accepts application/json
Authorization string Yes Token in format Bearer __token__ obtained from login API
Parameters
Body
Headers
Parameters
Response

                                

                            
HTTP 200 OK

{
  "total_links": 123,
  "total_clicks": 12345
}
Creates short URL, to request a custom alias use domain parameter described below.
Headers
Name Type Required Description
Accept string Yes Only accepts application/json
Authorization string Yes Token in format Bearer __token__ obtained from login API
Content-Type string Yes application/x-www-form-urlencoded
Parameters
Name Type Required Description
url string Yes Long url
domain string No Branded domain
Body
{
  "domain": "my.domain.com",
  "url": "http://long.url.com"
}
Headers
Parameters
Response

                                

                            
HTTP 200 OK

{
  "error": 0,
  "short": "http://clkim.mydomain.com/alIaS",
  "qr": "http://clkim.mydomain.com/alIaS/qr",
  "id": 123456,
  "alias": "alIaS"
}
Displays a url with statistics
Headers
Name Type Required Description
Accept string Yes Only accepts application/json
Authorization string Yes Token in format Bearer __token__ obtained from login API
Parameters
Name Type Required Description
url_id integer Yes ID of the url
start_date string Yes Start date [dd/mm/Y]
end_date string Yes End date [dd/mm/Y]
total_clicks_geo string No The number of clicks at the address with the name of the geo [during all this time]
total_clicks_browser string No The number of clicks at the address with the name of the browser
total_clicks_browser_language string No The number of clicks at the address with the name of the language
total_clicks_os string No The number of clicks at the address with the name of the os
referrer_split bool No Show the percentage of clicks in the locations [during all this time]
geo_split bool No Show the percentage of clicks in the geo [during all this time]
Body
Headers
Parameters
Response

                                

                            
HTTP 200 OK

{
  "total_clicks": 12345,
  "total_clicks_by_geo": {
    "country": "US",
    "total_clicks": 2
  },
  "browser": {
    "name": "Chrome 56",
    "total_clicks": 43
  },
  "language": {
    "name": "en-us",
    "total_clicks": 2
  },
  "os": {
    "name": "iOS 10",
    "total_clicks": 1
  },
  "referrer_split_percent": {
    "facebook.com": 10,
    "m.facebook.com": 90
  },
  "geo_split_percent": {
    "AE": 5,
    "US": 95
  }
}
Updates an existing url
Headers
Name Type Required Description
Accept string Yes Only accepts application/json
Authorization string Yes Token in format Bearer __token__ obtained from login API
Content-Type string Yes application/x-www-form-urlencoded
Parameters
Name Type Required Description
url_id integer Yes ID of the url
alias string No The og image url
og_title string No The og title
og_description string No The of description
og_site_name string No The og site name
redirection_type string No Redirection type for the Url
interstitial_frame_url string No Interstitial frame url
interstitial_mobile_frame_url string No interstitial mobile frame url
tracking_code object No Type: google or facebook
Body
{
  "og_image_url": "http://test.com/test.jpg",
  "og_title": "test title",
  "og_description": "test description",
  "og_site_name": "test",
  "redirection_type": "direct",
  "interstitial_frame_url": "http://test.com",
  "interstitial_mobile_frame_url": "http://test.mobile.com"
}
Headers
Parameters
Response

                                

                            
HTTP 200 OK

{
  "url_id": 1,
  "alias": "lswE",
  "user_id": 1,
  "url": "https://blog.ru/artist/444444",
  "created_at": "2016-03-23 12:12:12",
  "updated_at": "2016-03-23 12:46:12"
}
Updates geo targeting an existing url
Headers
Name Type Required Description
Accept string Yes Only accepts application/json
Authorization string Yes Token in format Bearer __token__ obtained from login API
Content-Type string Yes application/x-www-form-urlencoded
Parameters
Name Type Required Description
url_id integer Yes ID of the url
country string Yes Country of the url
link boolean Yes Redirected address
Body
{
  "country": "United States",
  "link": "http://google.ru"
}
Headers
Parameters
Response

                                

                            
HTTP 200 OK

{
  "url_id": 1,
  "alias": "lswE",
  "user_id": 1,
  "url": "https://blog.ru/artist/444444",
  "created_at": "2016-03-23 12:12:12",
  "updated_at": "2016-03-23 12:46:12",
  "geo_targeting": "{...}"
}
Updates OS targeting on existing url
Headers
Name Type Required Description
Accept string Yes Only accepts application/json
Authorization string Yes Token in format Bearer __token__ obtained from login API
Content-Type string Yes application/x-www-form-urlencoded
Parameters
Name Type Required Description
url_id integer Yes ID of the url
ios string No ios
androidos string No androidos
Body
{
  "ios": "http://test.ios.com",
  "androidos": "http://test.androidos.com"
}
Headers
Parameters
Response

                                

                            
HTTP 200 OK

{
  "url_id": 1,
  "alias": "lswE",
  "user_id": 1,
  "url": "https://blog.ru/artist/444444",
  "created_at": "2016-03-23 12:12:12",
  "updated_at": "2016-03-23 12:46:12",
  "os_targeting": "{...}"
}
Updates utm on existing url
Headers
Name Type Required Description
Accept string Yes Only accepts application/json
Authorization string Yes Token in format Bearer __token__ obtained from login API
Content-Type string Yes application/x-www-form-urlencoded
Parameters
Name Type Required Description
url_id integer Yes ID of the url
name string Yes Utm name
value boolean Yes Utm value
Body
{
  "name": "utm_source",
  "value": "google"
}
Headers
Parameters
Response

                                

                            
HTTP 200 OK

{
  "url_id": 1,
  "alias": "lswE",
  "user_id": 1,
  "url": "https://blog.ru/artist/444444",
  "created_at": "2016-03-23 12:12:12",
  "updated_at": "2016-03-23 12:46:12",
  "utm": "{...}"
}