Links
"Link" refers to shortened link. You can create, access, update and delete Link.
Create link
POST https://to.click/api/v1/links
HEADERS
X-AUTH-TOKEN: jvuhNJgV59Wo6HRmtVxEgDEU
Content-Type: application/json
BODY
{ "data": { "type": "link", "attributes": { "short_url": "asdasdasd1111", "web_url": "lenta.ru", "pixel_ids": [1] } }}
Sample Request
curl --request POST --url
https://to.click/api/v1/links
--header 'Content-Type: application/json' --header 'X-AUTH-TOKEN: jvuhNJgV59Wo6HRmtVxEgDEU'
--data '{ "data": { "type": "link", "attributes": { "short_url": "some_custom_slug", "web_url": "https://lenta.ru", "pixel_ids": [] } }}'
JSON element
Description
Type
Required?
short_url
Short URL will contain this name as URI
String
No
web_url
URL to redirect if platform is web
String
At least one parameter from [web_url, ios_url, android_url] is required
ios_url
URL to redirect if platform is iOS
String
At least one parameter from [web_url, ios_url, android_url] is required
android_url
URL to redirect if platform is Android
String
At least one parameter from [web_url, ios_url, android_url] is required
pixel_ids
Array of pixel IDs to link with
[] of Ints
No
Sample Response
{
"data": {
"id": "4095",
"type": "link",
"attributes": {
"full_url": "http://clc.la/some_custom_slug",
"id": 4095,
"short_url": "some_custom_slug",
"web_url": "http://lenta.ru",
"ios_url": null,
"android_url": null,
"is_stat_secret": false,
"created_at": "2018-03-01T12:54:48.728+03:00",
"ios_fallback_url": null,
"android_fallback_url": null,
"kind_of": "short",
"domain_id": null,
"pixel_ids": []
}
}
}
JSON element
Descriptions
Type
Can be empty?
short_url
Custom part of URI
String
No
full_url
Full short URL
String
No
web_url
Shortened URL
String
Yes
android_url
Shortened URL
String
Yes
ios_url
Shortened URL
String
Yes
is_stat_secret
Stat is secret or publicly available
Boolean
No
created_at
Date of creation
Datetime
No
ios_fallback_url
URL to store if app is not installed
String
Yes
android_fallback_url
URL to store if app is not onstalled
String
Yes
kind_of
LInk type
String
No
domain_id
ID of your domain
Int
Yes
pixel_ids
ID of linked pixels
[] of Int
Yes
Update link
PUT https://to.click/api/v1/links/1
HEADERS
X-AUTH-TOKEN: jvuhNJgV59Wo6HRmtVxEgDEU
Content-Type: application/json
BODY
{ "data": { "id": "1", "type": "link", "attributes": { "short_url": "asdasdasd", "web_url": "lenta.ru", "pixel_ids": [1,2] } }}
Sample Request
curl --request PUT --url
https://to.click/api/v1/links/1
--header 'Content-Type: application/json' --header 'X-AUTH-TOKEN: jvuhNJgV59Wo6HRmtVxEgDEU'
--data '{ "data": { "id": "1", "type": "link", "attributes": { "short_url": "asdasdasd", "web_url": "lenta.ru", "pixel_ids": [1,2] } }}'
Delete link
DELETE http://click.to/api/v1/links/2396
HEADERS
X-AUTH-TOKEN: jvuhNJgV59Wo6HRmtVxEgDEU
Content-Type: application/json
Sample Request
curl --request DELETE --url
http://click.to/api/v1/links/2396
--header 'Content-Type: application/json' --header 'X-AUTH-TOKEN: jvuhNJgV59Wo6HRmtVxEgDEU'
Access link
GET https://to.click/api/v1/links/234
HEADERS
X-AUTH-TOKEN: jvuhNJgV59Wo6HRmtVxEgDEU
Content-Type: application/json
Sample Request
curl --request GET --url
https://to.click/api/v1/links/234
--header 'Content-Type: application/json' --header 'X-AUTH-TOKEN: jvuhNJgV59Wo6HRmtVxEgDEU'
Get all links
GET https://to.click/api/v1/links
HEADERS
X-AUTH-TOKEN: jvuhNJgV59Wo6HRmtVxEgDEU
Content-Type: application/json
Sample Request
curl --request GET --url
https://to.click/api/v1/links
--header 'Content-Type: application/json' --header 'X-AUTH-TOKEN: jvuhNJgV59Wo6HRmtVxEgDEU'
Last updated
Was this helpful?