短网址缩短API接口

这边记录下wai.cn 短网址的api机制,wai.cn比较好记录。

请求

接口地址: https://api.wai.cn/v1/api/chains.list
请求方法: POST
请求示例: https://api.wai.cn/v1/api/chains.list?access_token=xxxxxxx

请求参数说明

参数名类型是否必传描述
access_token string 身份令牌
target_url string 跳转链接,必须以 http:// 或 https:// 开头的链接
group_id int 分组ID,不填写则使用默认分组
chain_title string 短链标题,不填则默认为’未命名’
domain string 专属域名,不填则默认为系统分配的域名
valid_time string 短链到期时间,例如2024-05-21 12:00:00,不传即为永久有效

返回参数说明

参数名类型描述
code int 状态码
success bool 状态:true 成功 false 失败
message string 返回状态信息
data array 返回的数据

返回结果示例

{
  "requestId": "446df4a1-b810-47e8-af72-e22268af4924",
  "path": "/api/v1/chains.create",
  "success": true,
  "message": "请求成功",
  "code": 200,
  "data": {
    "chain_title": "未命名",//短链名称
    "render_url": "http://www.myxcxdz.com/5qbrbL",//短链
    "target_url": "https://www.baidu.com"//跳转地址
  }
}
posted @ 2024-07-04 15:28  微客云  阅读(172)  评论(0)    收藏  举报