短链接

获取分组下短链

吕遥
发布于 2024-12-04 11:58:07

接口功能

可以获取某个分组下的短链列表,包含名称、短链、原始链接以及其他信息。

接口地址

https://api.xiaomark.com/v2/sl/link/batch_get

请求方法

POST

请求参数说明

参数名类型是否必传描述
apikeystring团队的API密钥
group_idstring分组id
offsetinteger起始位置,默认为0
countinteger请求数量,不超过100,默认为10

JSON请求示例

{
    "apikey": "5ac55544645cf99e40b14b4e78de5d90",
    "group_id": "81myhfrn",
    "offset": 0,
    "count": 20
}

返回数据说明

字段名类型描述
codeinteger返回码,0 代表请求成功,其他数值代表出错,详细见“返回码说明”页面
messagestring“请求成功”,或者相应的错误信息
dataobject请求成功返回的数据
    linksarray<object>短链列表
        urlstring短链地址
        domainstring短链域名
        create_timeinteger短链创建时间(以秒为单位的时间戳)
        project_idstring短链所在项目id
        group_idstring短链所在分组id
        namestring短链名称
        target_urlstring短链跳转到的目标链接
        escape_from_wechatboolean是否开启了微信内强制浏览器打开
        advanced_bot_detectionboolean是否开启了深度过滤机器访问
        webhookboolean是否开启了事件推送
        webhook_scenestring事件推送场景值
        suspendedboolean是否已停止跳转
        bannedboolean是否已被封禁
    countinteger此次请求返回的短链数量
    totalinteger短链总数

JSON返回示例

{
    "code": 0,
    "message": "请求成功",
    "data": {
        "links": [
            {
                "url": "https://sourl.cn/6GtdVb",
                "domain": "sourl.cn",
                "create_time": 1732768208,
                "project_id": "658d4d8a38c8a5a89e3b21d4",
                "group_id": "81myhfrn",
                "name": "短链6GtdVb",
                "target_url": "https://xiaomark.com/shortlink",
                "escape_from_wechat": false,
                "advanced_bot_detection": true,
                "webhook": false,
                "webhook_scene": "",
                "suspended": true,
                "banned": false
            },
            {
                "url": "https://sourl.cn/biMfBE",
                "domain": "sourl.cn",
                "create_time": 1732780302,
                "project_id": "658d4d8a38c8a5a89e3b21d4",
                "group_id": "81myhfrn",
                "name": "图片压缩",
                "target_url": "https://docsmall.com/image-compress",
                "escape_from_wechat": true,
                "advanced_bot_detection": false,
                "webhook": true,
                "webhook_scene": "image-compress",
                "suspended": false,
                "banned": false
            },
            {
                "url": "https://s.xma.im/cVh7rh",
                "domain": "s.xma.im",
                "create_time": 1732798635,
                "project_id": "658d4d8a38c8a5a89e3b21d4",
                "group_id": "81myhfrn",
                "name": "产品套餐定价方案",
                "target_url": "https://xiaomark.com/plan/shortlink",
                "escape_from_wechat": false,
                "advanced_bot_detection": true,
                "webhook": true,
                "webhook_scene": "plan",
                "suspended": false,
                "banned": false
            }
        ],
        "count": 3,
        "total": 3
    }
}
小码至营logo