文档中心 > API类目 > 天眼工作室API

alibaba.security.deepvision.devicemanager.getauthkey (获取AuthKey)

设备授权申请,以获取authKey

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
uid String 必须 1 用户ID
test Number 可选 1
  • 默认值:0
  • 是否测试:0-否,1-是
    function String 必须 face 要授权的功能
    activation_code String 必须 1 激活码
    user_device_id String 必须 1 用户设备标识,建议唯一
    device_id String 可选 1 业务上的设备id,若客户端有,则传,本设备不会当新设备处理
    umid_token String 可选 1 设备指纹Token
    umid_type String 可选 umid
  • 默认值:umid
  • 设备指纹类型
    app_name String 可选 123 appName

    响应参数

    名称 类型 示例值 描述
    result Result 对象 接口返回model
    • └ msg
    • String
    • 成功
    • 返回描述,错误信息
    • └ code
    • Number
    • 200
    • 返回码,200表示成功
    • data
    • AuthKeyResp
    • 对象
    • 返回对象
    • └ pub_key
    • String
    • Kuxsw8d......
    • RSA公钥
    • └ device_id
    • String
    • 1
    • 服务端为该设备分配的设备ID
    • └ auth_key
    • String
    • 1
    • 授权key

    请求示例

    • JAVA
    • .NET
    • PHP
    • CURL
    • Python
    • C/C++
    • NodeJS
    TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
    AlibabaSecurityDeepvisionDevicemanagerGetauthkeyRequest req = new AlibabaSecurityDeepvisionDevicemanagerGetauthkeyRequest();
    req.setUid("1");
    req.setTest(1L);
    req.setFunction("face");
    req.setActivationCode("1");
    req.setUserDeviceId("1");
    req.setDeviceId("1");
    req.setUmidToken("1");
    req.setUmidType("umid");
    req.setAppName("123");
    AlibabaSecurityDeepvisionDevicemanagerGetauthkeyResponse rsp = client.execute(req);
    System.out.println(rsp.getBody());

    响应示例

    • XML示例
    • JSON示例
    <alibaba_security_deepvision_devicemanager_getauthkey_response>
        <result>
            <msg>成功</msg>
            <code>200</code>
            <data>
                <pub_key>Kuxsw8d......</pub_key>
                <device_id>1</device_id>
                <auth_key>1</auth_key>
            </data>
        </result>
    </alibaba_security_deepvision_devicemanager_getauthkey_response>

    异常示例

    • XML示例
    • JSON示例
    <error_response>
        <code>50</code>
        <msg>Remote service error</msg>
        <sub_code>isv.invalid-parameter</sub_code>
        <sub_msg>非法参数</sub_msg>
    </error_response>

    错误码解释

    错误码 错误描述 解决方案

    API工具

    如何获得此API

    FAQ

    返回
    顶部