Skip to content

Latest commit

 

History

History
292 lines (229 loc) · 9.87 KB

AlipayOpenPublicTopicApi.md

File metadata and controls

292 lines (229 loc) · 9.87 KB

AlipayOpenPublicTopicApi

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

Method HTTP request Description
batchquery POST /v3/alipay/open/public/topic/batchquery 营销位查询接口
create POST /v3/alipay/open/public/topic/create 营销位添加接口
delete DELETE /v3/alipay/open/public/topic/delete 营销位删除接口
modify POST /v3/alipay/open/public/topic/modify 营销位修改接口

batchquery

AlipayOpenPublicTopicBatchqueryResponseModel 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.AlipayOpenPublicTopicApi;

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

    AlipayOpenPublicTopicApi apiInstance = new AlipayOpenPublicTopicApi(defaultClient);
    try {
      AlipayOpenPublicTopicBatchqueryResponseModel result = apiInstance.batchquery();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling AlipayOpenPublicTopicApi#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

AlipayOpenPublicTopicBatchqueryResponseModel

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

AlipayOpenPublicTopicCreateResponseModel create(alipayOpenPublicTopicCreateModel)

营销位添加接口

开发者可以通过此接口,在生活号主页中配置营销位,支持展示4-8个营销位,满足商家对业务的需求,需要注意的是,当某个营销位需要显示为头图时,必须要配置以下三个参数:营销位描述 (sub_title)、营销位图片(img_url)、营销位链接地址(link_url),如不需要展示头图时,以上三个参数均不要传。

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

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

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

Return type

AlipayOpenPublicTopicCreateResponseModel

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

delete

Object delete(topicId)

营销位删除接口

通过此接口,开发者可以根据营销位的分组group删除指定的营销位。

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

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

    AlipayOpenPublicTopicApi apiInstance = new AlipayOpenPublicTopicApi(defaultClient);
    String topicId = "CG202011131013300867029"; // String | 营销位id
    try {
      Object result = apiInstance.delete(topicId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling AlipayOpenPublicTopicApi#delete");
      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
topicId String 营销位id [optional]

Return type

Object

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

modify

Object modify(alipayOpenPublicTopicModifyModel)

营销位修改接口

通过此接口,开发者可以修改已经在生活号主页配置的营销位具体信息,包括标题、描述、链接等信息。需要注意的是,当某个营销位需要显示为头图时,必须要配置以下三个参数:营销位描述 (sub_title)、营销位图片(img_url)、营销位链接地址(link_url),如不需要展示头图时,以上三个参数均不要传。请注意修改是针对整套营销位,会覆盖之前的营销位。

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

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

    AlipayOpenPublicTopicApi apiInstance = new AlipayOpenPublicTopicApi(defaultClient);
    AlipayOpenPublicTopicModifyModel alipayOpenPublicTopicModifyModel = new AlipayOpenPublicTopicModifyModel(); // AlipayOpenPublicTopicModifyModel | 
    try {
      Object result = apiInstance.modify(alipayOpenPublicTopicModifyModel);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling AlipayOpenPublicTopicApi#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
alipayOpenPublicTopicModifyModel AlipayOpenPublicTopicModifyModel [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 请求失败 -