文档中心 > API类目 > 饿了么API

alibaba.alsc.user.auth.preauthtoken.apply (申请preAuthToken)

申请preAuthToken

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
alsc_pre_auth_open_request AlscPreAuthOpenRequest 必须 请求模型
  • └ scene_code
  • String
  • 必须
  • ELEME_YHHTZX
  • 业务方接入时向饿了么平台申请的场景码

响应参数

名称 类型 示例值 描述
pre_auth_url String https://r.ele.me/alsc-user-auth/blank.html?preAuthToken=d7702030d6fa4336b9c4429412109abf 预授权页面链接
pre_auth_token String d7702030d6fa4336b9c4429412109abf 预授权token

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaAlscUserAuthPreauthtokenApplyRequest req = new AlibabaAlscUserAuthPreauthtokenApplyRequest();
AlibabaAlscUserAuthPreauthtokenApplyRequest.AlscPreAuthOpenRequest obj1 = new AlibabaAlscUserAuthPreauthtokenApplyRequest.AlscPreAuthOpenRequest();
obj1.setSceneCode("ELEME_YHHTZX");
req.setAlscPreAuthOpenRequest(obj1);
AlibabaAlscUserAuthPreauthtokenApplyResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_alsc_user_auth_preauthtoken_apply_response>
    <pre_auth_url>https://r.ele.me/alsc-user-auth/blank.html?preAuthToken=d7702030d6fa4336b9c4429412109abf</pre_auth_url>
    <pre_auth_token>d7702030d6fa4336b9c4429412109abf</pre_auth_token>
</alibaba_alsc_user_auth_preauthtoken_apply_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

返回
顶部