文档中心 > API类目 > 智慧园区API

alibaba.guard.access.auth (鉴权)

刷卡鉴权

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
identify_auth_dto IdentifyAuthDTO 可选 鉴权结果DTO
  • └ auth_type_enum
  • String
  • 必须
  • CONTROLLER_SINGLE_VOUCHER
  • 指定鉴权类型
  • └ properties_json
  • String
  • 必须
  • {}
  • 属性json
  • voucher_list
  • VoucherDTO []
  • 必须
  • []
  • []
  • └ voucher_no
  • String
  • 必须
  • 0092027340
  • 卡号
  • └ voucher_type_enum
  • String
  • 必须
  • 类型枚举
  • xxx
  • └ app_code
  • String
  • 必须
  • 08988
  • 应用code
  • └ device_id
  • String
  • 必须
  • xxxx
  • 子设备ID
  • └ time_stamp
  • Number
  • 必须
  • 12221
  • 时间戳
  • └ sign
  • String
  • 必须
  • xx
  • 签名

响应参数

名称 类型 示例值 描述
result PojoResult 结果
  • content
  • IdentifyAuthResultDto
  • 内容
  • └ biz_code
  • String
  • 123
  • 业务id
  • └ error_code
  • String
  • SUCCESS/PERMISSION_DENIED
  • 鉴权结果码
  • └ error_msg
  • String
  • 请通过/抱歉,没有权限
  • 鉴权结果消息
  • user
  • UserDTO
  • 用户信息
  • └ user_id
  • String
  • 1873872
  • 用户自定义ID
  • └ company_id
  • Number
  • 1000
  • 公司ID
  • └ name
  • String
  • name
  • name
  • └ error_code
  • String
  • 200
  • 错误码
  • └ error_msg
  • String
  • success
  • 接口请求响应码
  • └ success
  • Boolean
  • true
  • 接口是否请求成功

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaGuardAccessAuthRequest req = new AlibabaGuardAccessAuthRequest();
AlibabaGuardAccessAuthRequest.IdentifyAuthDTO obj1 = new AlibabaGuardAccessAuthRequest.IdentifyAuthDTO();
obj1.setAuthTypeEnum("CONTROLLER_SINGLE_VOUCHER");
obj1.setPropertiesJson("{}");
List<AlibabaGuardAccessAuthRequest.VoucherDTO> list3 = new ArrayList<AlibabaGuardAccessAuthRequest.VoucherDTO>();
AlibabaGuardAccessAuthRequest.VoucherDTO obj4 = new AlibabaGuardAccessAuthRequest.VoucherDTO();
list3.add(obj4);
obj4.setVoucherNo("0092027340");
obj4.setVoucherTypeEnum("类型枚举");
obj1.setVoucherList(list3);
obj1.setAppCode("08988");
obj1.setDeviceId("xxxx");
obj1.setTimeStamp(12221L);
obj1.setSign("xx");
req.setIdentifyAuthDto(obj1);
AlibabaGuardAccessAuthResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_guard_access_auth_response>
    <result>
        <content>
            <biz_code>123</biz_code>
            <error_code>SUCCESS/PERMISSION_DENIED</error_code>
            <error_msg>请通过/抱歉,没有权限</error_msg>
            <user>
                <user_id>1873872</user_id>
                <company_id>1000</company_id>
                <name>name</name>
            </user>
        </content>
        <error_code>200</error_code>
        <error_msg>success</error_msg>
        <success>true</success>
    </result>
</alibaba_guard_access_auth_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

返回
顶部