获取token

介绍

获取用戶 token:平台用户已登录,使用该接口可获取用户 token,避免用户二次登录,提升用户体验。

接口说明

请求地址:/open/api/v4/merchant/getToken

请求方式:POST

Header参数:

参数名参数类型是否必须参数说明
appIdStringtrue应用的唯一标识
timestampStringtrue当前 UTC 13位时间戳, 5分钟内有效
signStringtrue签名,签名方式可参考这里

Body参数:

参数名参数类型是否必须参数说明
emailStringtrue用户email

示例

请求参数

{
  "email": "[email protected]"
}

返回参数

参数名参数类型示例
successboolTrue
returnCodeString0000
returnMsgStringSUCCESS
extendString
dataObject
└idStringkklzDn3K/BvuSXs559OQfQ==
└accessTokenStringACH8945766425@ACH@kklzDn3K/BvuSXs559OQfQ==@PAY@cwqgsiyILMYNuMjhxhaQLpCX1hnntIqfL+V7uEqNu6I=@IO@g5aBrOrzxrfzsqs8W0cKR4VBugBZBSH5gYLOoL1eHICLR3GTygMCaCN3RvIMaeOUmy9PAVmFImjz+4uXR1MpRg==
└emailStringcwqgsiyILMYNuMjhxhaQLpCX1hnntIqfL+V7uEqNu6I=
traceIdString642e6990f3481462c6185b310ba2120b

成功返回示例:

{
  "success": true,
  "returnCode": "0000",
  "returnMsg": "SUCCESS",
  "extend": "",
  "data": {
    "id": "kklzDn3K/BvuSXs559OQfQ==",
    "accessToken": "ACH8945766425@ACH@kklzDn3K/BvuSXs559OQfQ==@PAY@cwqgsiyILMYNuMjhxhaQLpCX1hnntIqfL+V7uEqNu6I=@IO@g5aBrOrzxrfzsqs8W0cKR4VBugBZBSH5gYLOoL1eHICLR3GTygMCaCN3RvIMaeOUmy9PAVmFImjz+4uXR1MpRg==",
    "email": "cwqgsiyILMYNuMjhxhaQLpCX1hnntIqfL+V7uEqNu6I="
  },
  "traceId": "642e6990f3481462c6185b310ba2120b"
}

失败返回示例:

{
  "success": false,
  "returnCode": "10005",
  "returnMsg": "Invalid Request Parameters.",
  "extend": "",
  "data": null,
  "traceId": "6698d3c505f3c792097f33778d6fc0be"
}