Skip to content

Latest commit

 

History

History
80 lines (61 loc) · 2.72 KB

AlipayOpenAuthTokenAppApi.md

File metadata and controls

80 lines (61 loc) · 2.72 KB

AlipayOpenAuthTokenAppApi

All URIs are relative to https://openapi.alipay.com

Method HTTP request Description
query GET /v3/alipay/open/auth/token/app/query 查询某个应用授权AppAuthToken的授权信息

query

AlipayOpenAuthTokenAppQueryResponseModel query(appAuthToken)

查询某个应用授权AppAuthToken的授权信息

当商户把服务窗、店铺等接口的权限授权给ISV之后,支付宝会给ISV颁发一个app_auth_token。如若授权成功之后,ISV想知道用户的授权信息,如授权者、授权接口列表等信息,可以调用本接口查询某个app_auth_token对应的授权信息

Example

// Import classes:
import com.alipay.v3.ApiClient;
import com.alipay.v3.ApiException;
import com.alipay.v3.Configuration;
import com.alipay.v3.util.*;
import com.alipay.v3.api.models.*;
import com.alipay.v3.api.AlipayOpenAuthTokenAppApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://openapi.alipay.com");
    // 设置alipayConfig参数(全局设置一次)
    AlipayConfig config = new AlipayConfig();
    config.setAppId("app_id");
    config.setPrivateKey("private_key");
    config.setAlipayPublicKey("alipay_public_key");
    config.setEncryptKey("encrypt_key");
    defaultClient.setAlipayConfig(config);

    AlipayOpenAuthTokenAppApi apiInstance = new AlipayOpenAuthTokenAppApi(defaultClient);
    String appAuthToken = "201509BBeff9351ad1874306903e96b91d248A36"; // String | 应用授权令牌
    try {
      AlipayOpenAuthTokenAppQueryResponseModel result = apiInstance.query(appAuthToken);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling AlipayOpenAuthTokenAppApi#query");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
appAuthToken String 应用授权令牌 [optional]

Return type

AlipayOpenAuthTokenAppQueryResponseModel

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 common response -
0 请求失败 -