链接

说明
专家级
API 密钥应作为请求的授权标头中的不记名令牌发送. 获取您的 API 密钥.
列表

API endpoint:

GET
https://goo.cm/api/v1/links

请求示例:

curl --location --request GET 'https://goo.cm/api/v1/links' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {api_key}'
Parameter
类型
描述
search
optional string
The search query.
by
optional string
搜索方式. Possible values are: title for 标题, alias for 自定义后缀, url for URL. Defaults to: title.
status
optional integer
Filter by status. Possible values are: 0 for 所有, 1 for 激活, 2 for 已过期, 3 for 禁用. Defaults to: 0.
space
optional integer
Filter by space id.
domain
optional integer
Filter by domain id.
sort
optional string
排序. Possible values are: desc for 降序, asc for 升序, max for 最佳表现, min for 表现最差. Defaults to: desc.
per_page
optional int
每页结果. Possible values are: 10 to 100. Defaults to: 10.
Show

API endpoint:

GET
https://goo.cm/api/v1/links/{id}

请求示例:

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

API endpoint:

POST
https://goo.cm/api/v1/links

请求示例:

curl --location --request POST 'https://goo.cm/api/v1/links' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer {api_key}' \
--data-urlencode 'url={url}'
Parameter
类型
描述
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.
pixels
optional array
The pixel IDs to be integrated in the link.
disabled
optional integer
Whether the link is disabled or not. Possible values are: 0 for 激活, 1 for 禁用. Defaults to: 0.
privacy
optional integer
Whether the link stats are public or not. Possible values are: 0 for 公共, 1 for 私有, 2 for 密码. Defaults to: 0.
privacy_password
optional string
The password for the statistics page. Only works with privacy set to 2.
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 默认, 1 for Geographic, 2 for 操作系统, 4 for 交替.
country[index][key]
optional string
The code of the targeted country. The code must be in ISO 3166-1 alpha-2 standard.
country[index][value]
optional string
The 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 link where the user will be redirected to.
language[index][key]
optional string
The code of the targeted language. The code must be in ISO 639-1 alpha-2 standard.
language[index][value]
optional string
The link where the user will be redirected to.
rotation[index][value]
optional string
The link where the user will be redirected to.
Update

API endpoint:

PUT PATCH
https://goo.cm/api/v1/links/{id}

请求示例:

curl --location --request PUT 'https://goo.cm/api/v1/links/{id}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer {api_key}' \
--data-urlencode 'url={url}'
Parameter
类型
描述
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.
pixels
optional array
The pixel IDs to be integrated in the link.
disabled
optional integer
Whether the link is disabled or not. Possible values are: 0 for 激活, 1 for 禁用.
privacy
optional integer
Whether the link stats are public or not. Possible values are: 0 for 公共, 1 for 私有, 2 for 密码.
privacy_password
optional string
The password for the statistics page. Only works with privacy set to 2.
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 默认, 1 for Geographic, 2 for 操作系统, 4 for 交替.
country[index][key]
optional string
The code of the targeted country. The code must be in ISO 3166-1 alpha-2 standard.
country[index][value]
optional string
The 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 link where the user will be redirected to.
language[index][key]
optional string
The code of the targeted language. The code must be in ISO 639-1 alpha-2 standard.
language[index][value]
optional string
The link where the user will be redirected to.
rotation[index][value]
optional string
The link where the user will be redirected to.
删除

API endpoint:

DELETE
https://goo.cm/api/v1/links/{id}

请求示例:

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