All URIs are relative to https://openapi.alipay.com
Method | HTTP request | Description |
---|---|---|
batchquery | POST /v3/alipay/open/public/advert/batchquery | 生活号广告位查询接口 |
create | POST /v3/alipay/open/public/advert/create | 生活号广告位添加接口 |
delete | DELETE /v3/alipay/open/public/advert/delete | 生活号广告位删除接口 |
modify | POST /v3/alipay/open/public/advert/modify | 生活号广告位修改接口 |
AlipayOpenPublicAdvertBatchqueryResponseModel batchquery()
生活号广告位查询接口
可以通过此接口查询所有广告位的配置信息
// 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.AlipayOpenPublicAdvertApi;
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);
AlipayOpenPublicAdvertApi apiInstance = new AlipayOpenPublicAdvertApi(defaultClient);
try {
AlipayOpenPublicAdvertBatchqueryResponseModel result = apiInstance.batchquery();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AlipayOpenPublicAdvertApi#batchquery");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
This endpoint does not need any parameter.
AlipayOpenPublicAdvertBatchqueryResponseModel
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | common response | - |
0 | 请求失败 | - |
AlipayOpenPublicAdvertCreateResponseModel create(alipayOpenPublicAdvertCreateModel)
生活号广告位添加接口
可通过本接口在生活号主页添加广告位,根据业务需求配置不同的图片和跳转链接
// 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.AlipayOpenPublicAdvertApi;
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);
AlipayOpenPublicAdvertApi apiInstance = new AlipayOpenPublicAdvertApi(defaultClient);
AlipayOpenPublicAdvertCreateModel alipayOpenPublicAdvertCreateModel = new AlipayOpenPublicAdvertCreateModel(); // AlipayOpenPublicAdvertCreateModel |
try {
AlipayOpenPublicAdvertCreateResponseModel result = apiInstance.create(alipayOpenPublicAdvertCreateModel);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AlipayOpenPublicAdvertApi#create");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
alipayOpenPublicAdvertCreateModel | AlipayOpenPublicAdvertCreateModel | [optional] |
AlipayOpenPublicAdvertCreateResponseModel
No authorization required
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | common response | - |
0 | 请求失败 | - |
Object delete(advertId, advertGroup)
生活号广告位删除接口
可以通过此接口删除指定广告位的配置信息
// 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.AlipayOpenPublicAdvertApi;
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);
AlipayOpenPublicAdvertApi apiInstance = new AlipayOpenPublicAdvertApi(defaultClient);
String advertId = "123"; // String | 待删除的广告位id,删除通投广告位需传递此参数
String advertGroup = "CG202008041013200064690"; // String | 待删除的广告位分组标识,删除个性化广告位需传递此参数。
try {
Object result = apiInstance.delete(advertId, advertGroup);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AlipayOpenPublicAdvertApi#delete");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
advertId | String | 待删除的广告位id,删除通投广告位需传递此参数 | [optional] |
advertGroup | String | 待删除的广告位分组标识,删除个性化广告位需传递此参数。 | [optional] |
Object
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | common response | - |
0 | 请求失败 | - |
Object modify(alipayOpenPublicAdvertModifyModel)
生活号广告位修改接口
可以通过此接口修改指定广告位的配置信息
// 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.AlipayOpenPublicAdvertApi;
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);
AlipayOpenPublicAdvertApi apiInstance = new AlipayOpenPublicAdvertApi(defaultClient);
AlipayOpenPublicAdvertModifyModel alipayOpenPublicAdvertModifyModel = new AlipayOpenPublicAdvertModifyModel(); // AlipayOpenPublicAdvertModifyModel |
try {
Object result = apiInstance.modify(alipayOpenPublicAdvertModifyModel);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AlipayOpenPublicAdvertApi#modify");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
alipayOpenPublicAdvertModifyModel | AlipayOpenPublicAdvertModifyModel | [optional] |
Object
No authorization required
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | common response | - |
0 | 请求失败 | - |