Skip to content

Latest commit

 

History

History
288 lines (226 loc) · 9.07 KB

AlipayOpenPublicMenuApi.md

File metadata and controls

288 lines (226 loc) · 9.07 KB

AlipayOpenPublicMenuApi

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

Method HTTP request Description
batchquery POST /v3/alipay/open/public/menu/batchquery 菜单列表查询接口
create POST /v3/alipay/open/public/menu/create 默认菜单创建接口
modify POST /v3/alipay/open/public/menu/modify 默认菜单更新接口
query GET /v3/alipay/open/public/menu/query 公众服务平台查询菜单

batchquery

AlipayOpenPublicMenuBatchqueryResponseModel batchquery()

菜单列表查询接口

开发者可调用该接口查询自己创建的菜单列表

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.AlipayOpenPublicMenuApi;

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);

    AlipayOpenPublicMenuApi apiInstance = new AlipayOpenPublicMenuApi(defaultClient);
    try {
      AlipayOpenPublicMenuBatchqueryResponseModel result = apiInstance.batchquery();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling AlipayOpenPublicMenuApi#batchquery");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

This endpoint does not need any parameter.

Return type

AlipayOpenPublicMenuBatchqueryResponseModel

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 请求失败 -

create

AlipayOpenPublicMenuCreateResponseModel create(alipayOpenPublicMenuCreateModel)

默认菜单创建接口

开发者可调用该接口为生活号创建一套默认菜单,当用户进入生活号主页时,若没有命中任何个性化菜单,则会展示该默认菜单,每个生活号必须有一套默认菜单

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.AlipayOpenPublicMenuApi;

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);

    AlipayOpenPublicMenuApi apiInstance = new AlipayOpenPublicMenuApi(defaultClient);
    AlipayOpenPublicMenuCreateModel alipayOpenPublicMenuCreateModel = new AlipayOpenPublicMenuCreateModel(); // AlipayOpenPublicMenuCreateModel | 
    try {
      AlipayOpenPublicMenuCreateResponseModel result = apiInstance.create(alipayOpenPublicMenuCreateModel);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling AlipayOpenPublicMenuApi#create");
      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
alipayOpenPublicMenuCreateModel AlipayOpenPublicMenuCreateModel [optional]

Return type

AlipayOpenPublicMenuCreateResponseModel

Authorization

No authorization required

HTTP request headers

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

HTTP response details

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

modify

Object modify(alipayOpenPublicMenuModifyModel)

默认菜单更新接口

开发者可调用该接口更新默认菜单,菜单更新成功后实时生效

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.AlipayOpenPublicMenuApi;

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);

    AlipayOpenPublicMenuApi apiInstance = new AlipayOpenPublicMenuApi(defaultClient);
    AlipayOpenPublicMenuModifyModel alipayOpenPublicMenuModifyModel = new AlipayOpenPublicMenuModifyModel(); // AlipayOpenPublicMenuModifyModel | 
    try {
      Object result = apiInstance.modify(alipayOpenPublicMenuModifyModel);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling AlipayOpenPublicMenuApi#modify");
      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
alipayOpenPublicMenuModifyModel AlipayOpenPublicMenuModifyModel [optional]

Return type

Object

Authorization

No authorization required

HTTP request headers

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

HTTP response details

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

query

AlipayOpenPublicMenuQueryResponseModel query()

公众服务平台查询菜单

开发者通过调用该接口查询菜单。

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.AlipayOpenPublicMenuApi;

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);

    AlipayOpenPublicMenuApi apiInstance = new AlipayOpenPublicMenuApi(defaultClient);
    try {
      AlipayOpenPublicMenuQueryResponseModel result = apiInstance.query();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling AlipayOpenPublicMenuApi#query");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

This endpoint does not need any parameter.

Return type

AlipayOpenPublicMenuQueryResponseModel

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 请求失败 -