链接

备注
专家模式
API密钥应作为Bearer令牌放在请求的Authorization头中。 获取您的API密钥.
列表

API端点:

GET
https://kdwz.cn/api/v1/links

请求示例:

curl --location --request GET 'https://kdwz.cn/api/v1/links' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {api_key}'
参数
类型
描述
search
可选 string
搜索关键词.
search_by
可选 string
搜索方式. 可选值:标题 的 title, 别名 的 alias, 链接 的 url。 默认值:title。
status
可选 integer
状态. 可选值:全部 的 0, 活跃 的 1, 已过期 的 2, 已禁用 的 3。 默认值:0。
space_id
可选 integer
空间ID.
domain_id
可选 integer
域名ID.
pixel_id
可选 integer
像素ID.
sort_by
可选 string
排序方式. 可选值:创建日期 的 id, 点击量 的 clicks, 标题 的 title, 别名 的 alias, 链接 的 url。 默认值:id。
sort
可选 string
排序. 可选值:降序 的 desc, 升序 的 asc。 默认值:desc。
per_page
可选 integer
每页结果数. 可选值:10, 25, 50, 100。 默认值:25。
显示

API端点:

GET
https://kdwz.cn/api/v1/links/{id}

请求示例:

curl --location --request GET 'https://kdwz.cn/api/v1/links/{id}' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {api_key}'
创建

API端点:

POST
https://kdwz.cn/api/v1/links

请求示例:

curl --location --request POST 'https://kdwz.cn/api/v1/links' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer {api_key}' \
--data-urlencode 'url={url}' \
--data-urlencode 'domain={id}'
参数
类型
描述
url
必填 string
目标URL.
domain_id
必填 integer
域名ID.
alias
可选 string
别名.
space_id
可选 integer
空间ID.
pixel_ids[]
可选 array
像素ID.
redirect_password
可选 string
重定向密码.
sensitive_content
可选 integer
敏感内容. 可选值:否 的 0, 是 的 1。 默认值:0。
privacy
可选 integer
统计隐私. 可选值:公开 的 0, 私有 的 1, 密码 的 2。 默认值:0。
password
可选 string
统计密码. 仅在 privacy 字段设为 2 时生效。
active_period_start_at
可选 string
有效时段开始日期,格式:Y-m-dTH:i:s。
active_period_end_at
可选 string
有效时段结束日期,格式:Y-m-dTH:i:s。
clicks_limit
可选 integer
点击次数限制.
expiration_url
可选 string
过期跳转URL.
targets_type
可选 string
定向. 可选值:Continents 的 continents, Countries 的 countries, Operating systems 的 operating_systems, Browsers 的 browsers, Languages 的 languages, Devices 的 devices, Rotations 的 rotations。
targets[index][key]
可选 string
对于 targets_type=country,值必须符合 ISO 3166-1 alpha-2 格式。
For targets_type=operating_systems, the possible values are iOS, Android, Windows, OS X, Linux, Ubuntu, Chrome OS.
对于 targets_type=browsers,可选值为:Chrome, Chromium, Firefox, Firefox Mobile, Edge, Internet Explorer, Mobile Internet Explorer, Vivaldi, Brave, Safari, Opera, Opera Mini, Opera Mobile, Opera Touch, Yandex Browser, UC Browser, Samsung Internet, QQ Browser, BlackBerry Browser, Maxtho。
对于 targets_type=devices,可选值为:Desktop, Mobile, Tablet, Watch, Television。
对于 targets_type=languages,值必须符合 ISO 639-1 alpha-2 格式。
对于 targets_type=continents,可选值为:Africa 的 AF, Antarctica 的 AN, Asia 的 AS, Europe 的 EU, North America 的 NA, Oceania 的 OC, South America 的 SA。
targets[index][value]
可选 string
目标URL.
更新

API端点:

PUT PATCH
https://kdwz.cn/api/v1/links/{id}

请求示例:

curl --location --request PUT 'https://kdwz.cn/api/v1/links/{id}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer {api_key}'
参数
类型
描述
url
可选 string
目标URL.
alias
可选 string
别名.
space_id
可选 integer
空间ID.
pixel_ids[]
可选 array
像素ID.
redirect_password
可选 string
重定向密码.
sensitive_content
可选 integer
敏感内容. 可选值:否 的 0, 是 的 1。
privacy
可选 integer
统计隐私. 可选值:公开 的 0, 私有 的 1, 密码 的 2。
password
可选 string
统计密码. 仅在 privacy 字段设为 2 时生效。
active_period_start_at
可选 string
有效时段开始日期,格式:Y-m-dTH:i:s。
active_period_end_at
可选 string
有效时段结束日期,格式:Y-m-dTH:i:s。
clicks_limit
可选 integer
点击次数限制.
expiration_url
可选 string
过期跳转URL.
targets_type
可选 string
定向. 可选值:Continents 的 continents, Countries 的 countries, Operating systems 的 operating_systems, Browsers 的 browsers, Languages 的 languages, Devices 的 devices, Rotations 的 rotations。
targets[index][key]
可选 string
对于 targets_type=country,值必须符合 ISO 3166-1 alpha-2 格式。
For targets_type=operating_systems, the possible values are iOS, Android, Windows, OS X, Linux, Ubuntu, Chrome OS.
对于 targets_type=browsers,可选值为:Chrome, Chromium, Firefox, Firefox Mobile, Edge, Internet Explorer, Mobile Internet Explorer, Vivaldi, Brave, Safari, Opera, Opera Mini, Opera Mobile, Opera Touch, Yandex Browser, UC Browser, Samsung Internet, QQ Browser, BlackBerry Browser, Maxtho。
对于 targets_type=devices,可选值为:Desktop, Mobile, Tablet, Watch, Television。
对于 targets_type=languages,值必须符合 ISO 639-1 alpha-2 格式。
对于 targets_type=continents,可选值为:Africa 的 AF, Antarctica 的 AN, Asia 的 AS, Europe 的 EU, North America 的 NA, Oceania 的 OC, South America 的 SA。
targets[index][value]
可选 string
目标URL.
删除

API端点:

DELETE
https://kdwz.cn/api/v1/links/{id}

请求示例:

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