revokeToken
POST: /amsin/api/v1/oauth/revokeToken
调用此接口来撤销一个访问令牌(access token),撤消的令牌将无法再用于授权。
说明:撤销访问令牌的同时也撤消了刷新令牌(refresh token)。
接口结构
万里汇接口的报文结构包括:请求头、请求体、响应头和响应体。该章节主要介绍请求体和响应体的结构。关于请求头和响应头的更多信息,参见:
请求参数
字段名  | 数据类型  | 是否必传  | 描述  | 
token  | 字符串  | 是  | 取消访问令牌(access token) 时使用的令牌信息。 更多信息: 
  | 
tokenType  | 字符串  | 是  | 使用的令牌类型。可取值: 
 更多信息: 
  | 
响应参数
字段名  | 数据类型  | 是否必填  | 描述  | 
result  | Result 对象  | 是  | API的调用结果。  | 
说明:以下字段,只有当 result.resultStatus =   | |||
cancelTime  | DateTime字符串  | 有条件必填  | 撤销访问令牌的时间。 更多信息: 
  | 
响应处理
集成商调用接口后,万里汇通过 result.resultStatus 字段返回集成商 API 调用结果。此字段的取值范围如下:
result.resultStatus  | 描述  | 
  | API请求成功。  | 
  | API请求失败。具体失败原因,参见结果码(即 result.resultCode 和 result.resultMessage)。  | 
  | API响应结果为 重试策略: 
 如果问题依旧,请联系万里汇技术支持。  | 
结果码
result.resultCode
resultCode  | resultStatus  | resultMessage  | resultMessage 中文含义  | 处理建议  | 
SUCCESS  | S  | Success  | 成功  | |
PROCESS_FAIL  | F  | A general business failure occurred. Do Not retry.  | 请求处理失败,请勿重试  | 需要人工介入,联系万里汇技术支持以解决此问题  | 
PARAM_ILLEGAL  | F  | Illegal parameters exist. For example, a non-numeric input, or an invalid date.  | 参数异常  | 修改订单信息、更换requestId,发起重试  | 
INVALID_API  | F  | The called API is invalid or not active.  | 调用的接口已失效或停用  | 确认是否调用正确的API  | 
INVALID_CLIENT  | F  | The client is invalid.  | 调用的用户无效  | Client ID不存在或无效 | 
INVALID_SIGNATURE  | F  | The signature is invalid.  | 签名校验失败  | 确认请求正确加签,更换requestId,发起重试  | 
METHOD_NOT_SUPPORTED  | F  | The server does not implement the requested HTTP method.  | HTTP请求方法不支持。  | 确认HTTP请求方法为  | 
UNKNOWN_EXCEPTION  | U  | The API call is failed, which is caused by unknown reasons.  | 未知错误  | 无需更换requestId,发起重试  | 
UN_SUPPORT_BUSINESS  | F  | Unsupported business.  | 包含无效参数  | 包含无效参数,使用正确参数重试  | 
INVALID_ACCESS_TOKEN  | F  | The access token is invalid.  | 访问令牌(access token))已失效。  | 请使用正确的accessToken  | 
AUTHORIZATION_NOT_EXIST  | F  | The authorization does not exist.  | 授权不存在  | 当前授权关系不存在,请联系万里汇技术支持检查授权关系  | 
代码示例
示例一:成功
请求体
{
    "token": "282888130000470616850250350*****",
    "tokenType":"ACCESS_TOKEN"
}响应体
{
    "result": {
        "resultStatus": "S",
        "resultCode": "SUCCESS",
        "resultMessage": "success"
    },
    "cancelTime": "2023-05-29T06:27:25Z"
}示例二:失败
请求体
{
    "token": "282888130000470616850250350*****",
    "tokenType":"ACCESS_TOKEN"
}响应体
{
    "result": {
        "resultStatus": "F",
        "resultCode": "AUTHORIZATION_NOT_EXIST",
        "resultMessage": "The authorization not exist"
    }
}