Rút gọn Link

Notes
Expert level
The API key should be sent as a Bearer token in the Authorization header of the request. Get your API key.
List

API endpoint:

GET
https://go2.vn/api/v1/links

Request example:

curl --location --request GET 'https://go2.vn/api/v1/links' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {api_key}'
Parameter
Type
Description
search
optional string
The search query.
by
optional string
Search by. Possible values are: title for Tiêu đề, alias for Alias, url for URL.
status
optional integer
Filter by status. Possible values are: 0 for Tất cả, 1 for Kích hoạt, 2 for Hết hạn, 3 for Vô hiệu hóa.
space
optional integer
Filter by space id.
domain
optional integer
Filter by domain id.
sort
optional string
Sort by. Possible values are: desc for Giảm dần, asc for Tăng dần, max for Best performing, min for Least performing.
Show

API endpoint:

GET
https://go2.vn/api/v1/links/{id}

Request example:

curl --location --request GET 'https://go2.vn/api/v1/links/{id}' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {api_key}'
Store

API endpoint:

POST
https://go2.vn/api/v1/links

Request example:

curl --location --request POST 'https://go2.vn/api/v1/links' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer {api_key}' \
--data-urlencode 'url={url}'
Parameter
Type
Description
url
required string
The link to be shortened.
alias
optional string
The link alias.
password
optional string
The link password.
space
optional integer
The space id the link to be saved under.
domain
optional integer
The domain id the link to be saved under.
disabled
optional integer
Whether the link is disabled or not. Defaults to: 0.
public
optional integer
Whether the link stats are public or not. Defaults to: 0.
expiration_url
optional string
The link where the user will be redirected once the link has expired.
expiration_date
optional string
The link expiration date in YYYY-MM-DD format.
expiration_time
optional string
The link expiration time in HH:MM format.
expiration_clicks
optional integer
The number of clicks after which the link should expire.
target_type
optional integer
The type of targeting. Possible values are: 0 for None, 1 for Geographic, 2 for Platform, 3 for Rotation.
geo[index][key]
optional string
The code of the targeted country. The code must be in ISO 3166-1 alpha-2 standard.
geo[index][value]
optional string
The country link where the user will be redirected to.
platform[index][key]
optional string
The name of the targeted platform. Possible values are: iOS, Android, Windows, OS X, Linux, Ubuntu, Chrome OS.
platform[index][value]
optional string
The platform link where the user will be redirected to.
rotation[index][value]
optional string
The rotation link where the user will be redirected to.
Update

API endpoint:

PUT PATCH
https://go2.vn/api/v1/links/{id}

Request example:

curl --location --request PUT 'https://go2.vn/api/v1/links/{id}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer {api_key}' \
--data-urlencode 'url={url}'
Parameter
Type
Description
url
optional string
The link to be shortened.
alias
optional string
The link alias.
password
optional string
The link password.
space
optional integer
The space id the link to be saved under.
domain
optional integer
The domain id the link to be saved under.
disabled
optional integer
Whether the link is disabled or not. Defaults to: 0.
public
optional integer
Whether the link stats are public or not. Defaults to: 0.
expiration_url
optional string
The link where the user will be redirected once the link has expired.
expiration_date
optional string
The link expiration date in YYYY-MM-DD format.
expiration_time
optional string
The link expiration time in HH:MM format.
expiration_clicks
optional integer
The number of clicks after which the link should expire.
target_type
optional integer
The type of targeting. Possible values are: 0 for None, 1 for Geographic, 2 for Platform, 3 for Rotation.
geo[index][key]
optional string
The code of the targeted country. The code must be in ISO 3166-1 alpha-2 standard.
geo[index][value]
optional string
The country link where the user will be redirected to.
platform[index][key]
optional string
The name of the targeted platform. Possible values are: iOS, Android, Windows, OS X, Linux, Ubuntu, Chrome OS.
platform[index][value]
optional string
The platform link where the user will be redirected to.
rotation[index][value]
optional string
The rotation link where the user will be redirected to.
Xoá

API endpoint:

DELETE
https://go2.vn/api/v1/links/{id}

Request example:

curl --location --request DELETE 'https://go2.vn/api/v1/links/{id}' \
--header 'Authorization: Bearer {api_key}'