文档中心 > API类目 > 天猫精灵开放API

taobao.ailab.aicloud.top.id.list.converter (将淘宝openId或者设备id/用户id转换为openId)

将淘宝openId或者设备id/用户id转换为openId

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
convert_data ConverterIdRequest 必须 入参数据
  • └ id
  • String
  • 必须
  • 123
  • idType相应的id内容
  • └ encode_type
  • String
  • 必须
  • PROJECT_ID
  • 编码类型,此处填写PROJECT_ID。
  • └ encode_key
  • String
  • 必须
  • 345
  • 编码类型对应的值,此处填写该产品所在项目的Project ID。请在天猫精灵AI平台的控制台中查看。
  • └ id_type
  • String
  • 必须
  • USER_ID
  • USER_ID/DEVICE_ID/OPEN_TAOBAO_ID

响应参数

名称 类型 示例值 描述
result Result 返回体
  • └ rt_code
  • Number
  • 200
  • 返回code
  • └ is_success
  • Boolean
  • true
  • 请求状态
  • └ message
  • String
  • 查询失败
  • 返回错误信息
  • rt_value
  • OpenInfoResponse []
  • ""
  • 返回查询内容
  • param
  • ConverterIdRequest
  • 入参内容
  • └ id_type
  • String
  • USER_ID
  • id类型
  • └ id
  • String
  • DAFE****ce3ej=
  • idType相应的id内容
  • └ encode_type
  • String
  • PROJECT_ID
  • 编码类型
  • └ encode_key
  • String
  • 12**45
  • 编码类型对应的值,此处填写该产品所在项目的Project ID。请在天猫精灵AI平台的控制台中查看。
  • └ open_id
  • String
  • 123
  • 开放openId
  • union_ids
  • UnionIdInfo []
  • 关联id
  • └ organization_id
  • String
  • 123
  • 组织id
  • └ union_id
  • String
  • 123
  • 开放unionId

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AilabAicloudTopIdListConverterRequest req = new AilabAicloudTopIdListConverterRequest();
AilabAicloudTopIdListConverterRequest.ConverterIdRequest obj1 = new AilabAicloudTopIdListConverterRequest.ConverterIdRequest();
obj1.setId("123");
obj1.setEncodeType("PROJECT_ID");
obj1.setEncodeKey("345");
obj1.setIdType("USER_ID");
req.setConvertData(obj1);
AilabAicloudTopIdListConverterResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<ailab_aicloud_top_id_list_converter_response>
    <result>
        <rt_code>200</rt_code>
        <is_success>true</is_success>
        <message>查询失败</message>
        <rt_value>
            <open_info_response>
                <param>
                    <id_type>USER_ID</id_type>
                    <id>DAFE****ce3ej=</id>
                    <encode_type>PROJECT_ID</encode_type>
                    <encode_key>12**45</encode_key>
                </param>
                <open_id>123</open_id>
                <union_ids>
                    <union_id_info>
                        <organization_id>123</organization_id>
                        <union_id>123</union_id>
                    </union_id_info>
                </union_ids>
            </open_info_response>
        </rt_value>
    </result>
</ailab_aicloud_top_id_list_converter_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

返回
顶部