1. 设备

1.1. 签到

换取连接MQTT凭证。

1.1.1. 请求地址

/devices/signin

1.1.2. 请求参数

参数名 类型 是否必须 含义 备注
device_sn string true 设备编号 设备提供商为设备分配的唯一编号
device_type int true 设备类型 可用枚举值:0 - 打印、播报终端,1 - 其他。
device_vendor int true 设备提供商 0 - 无,1 - 新国都。
sign string true 签名字符串 使用md5加密后的签名字符串

1.1.3. 请求体示例

{
    "device_sn":"SN123456789",
    "device_type": 0,
    "device_vendor": 1,
    "sign": "d89a2e096b594c90057c31fb486323e5"
}

1.1.4. 返回参数

参数名 类型 含义 备注
endpoint string MQTT连接域名 post-cn-v0h1lp36505.mqtt.aliyuncs.com
port string MQTT服务器端口 1883
username string 连接用户名
password string 连接密码
client_id string 客户端在MQTT的唯一标识
topic string 订阅主题
sign string 参数签名 请验签以确保数据完整性

1.1.5. 返回示例 - 错误

{
    "code": "310014",
    "message": "签名验证失败"
}

1.1.6. 返回示例

{
    "code": "000000",
    "data": {
        "endpoint": "post-cn-v0h1lp36505.mqtt.aliyuncs.com",
        "port": 1883,
        "username": "Signature|Bx58ay4u8vJnop7w98lQTcMCNfMUMK|post-cn-v0h1lp36505",
        "password": "N9N5iBMTmKEHYUep3ZJzJbg9s40=",
        "client_id": "GID_PAY_NOTIFY@@@SN123456789",
        "topic": "PAY_NOTIFY/p2p/GID_PAY_NOTIFY@@@SN123456789"
    },
    "message": "签到成功"
}

results matching ""

    No results matching ""