接入指南
完整时序图

创建投放活动
示例代码
package com.java.sdk.demo;
import com.alipay.v3.ApiException;
import com.alipay.v3.ApiClient;
import com.alipay.v3.util.model.AlipayConfig;
import com.alipay.v3.Configuration;
import com.alipay.v3.api.AlipayOpenMiniTipsDeliveryApi;
import com.alipay.v3.model.*;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AlipayOpenMiniTipsDeliveryApiCreate {
public static void main(String[] args) throws ApiException {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// 初始化alipay参数(全局设置一次)
AlipayConfig alipayConfig = new AlipayConfig();
alipayConfig.setServerUrl("https://openapi.alipay.com");
alipayConfig.setAppId("<-- 请填写您的AppId,例如:2019091767145019 -->");
alipayConfig.setPrivateKey("<-- 请填写您的应用私钥,例如:MIIEvQIBADANB ... ... -->");
alipayConfig.setAlipayPublicKey("<-- 请填写您的支付宝公钥,例如:MIIBIjANBg... -->");
defaultClient.setAlipayConfig(alipayConfig);
AlipayOpenMiniTipsDeliveryApi api = new AlipayOpenMiniTipsDeliveryApi();
AlipayOpenMiniTipsDeliveryCreateModel data = new AlipayOpenMiniTipsDeliveryCreateModel();
data.setDeliveryContent("点击收藏,下次使用更方便");
data.setStartTime("2021-11-25 15:23:43");
data.setDeliveryName("收藏引导首页投放活动");
data.setMatchType("TARGETURL");
data.setMatchUrl("/page/web");
data.setEndTime("2022-12-31 15:23:43");
try {
AlipayOpenMiniTipsDeliveryCreateResponseModel response = api.create(data);
} catch (ApiException e) {
AlipayOpenMiniTipsDeliveryCreateDefaultResponse errorObject = (AlipayOpenMiniTipsDeliveryCreateDefaultResponse) e.getErrorObject();
System.out.println("调用失败:" + errorObject);
}
}
}
重要入参说明
活动配置规则
响应示例
{
"delivery_id":"20211111000000797023"
}
响应参数
修改投放活动状态
示例代码
package com.java.sdk.demo;
import com.alipay.v3.ApiException;
import com.alipay.v3.ApiClient;
import com.alipay.v3.util.model.AlipayConfig;
import com.alipay.v3.Configuration;
import com.alipay.v3.api.AlipayOpenMiniTipsDeliveryApi;
import com.alipay.v3.model.*;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AlipayOpenMiniTipsDeliveryApiModify {
public static void main(String[] args) throws ApiException {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// 初始化alipay参数(全局设置一次)
AlipayConfig alipayConfig = new AlipayConfig();
alipayConfig.setServerUrl("https://openapi.alipay.com");
alipayConfig.setAppId("<-- 请填写您的AppId,例如:2019091767145019 -->");
alipayConfig.setPrivateKey("<-- 请填写您的应用私钥,例如:MIIEvQIBADANB ... ... -->");
alipayConfig.setAlipayPublicKey("<-- 请填写您的支付宝公钥,例如:MIIBIjANBg... -->");
defaultClient.setAlipayConfig(alipayConfig);
AlipayOpenMiniTipsDeliveryApi api = new AlipayOpenMiniTipsDeliveryApi();
AlipayOpenMiniTipsDeliveryModifyModel data = new AlipayOpenMiniTipsDeliveryModifyModel();
data.setDeliveryId("20211114000003057595");
data.setOperateType("RESUME");
try {
Object response = api.modify(data);
} catch (ApiException e) {
AlipayOpenMiniTipsDeliveryModifyDefaultResponse errorObject = (AlipayOpenMiniTipsDeliveryModifyDefaultResponse) e.getErrorObject();
System.out.println("调用失败:" + errorObject);
}
}
}
重要入参说明
响应示例
{}
响应参数
查询活动详情
示例代码
package com.java.sdk.demo;
import com.alipay.v3.ApiException;
import com.alipay.v3.ApiClient;
import com.alipay.v3.util.model.AlipayConfig;
import com.alipay.v3.Configuration;
import com.alipay.v3.api.AlipayOpenMiniTipsDeliveryApi;
import com.alipay.v3.model.*;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AlipayOpenMiniTipsDeliveryApiQuery {
public static void main(String[] args) throws ApiException {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// 初始化alipay参数(全局设置一次)
AlipayConfig alipayConfig = new AlipayConfig();
alipayConfig.setServerUrl("https://openapi.alipay.com");
alipayConfig.setAppId("<-- 请填写您的AppId,例如:2019091767145019 -->");
alipayConfig.setPrivateKey("<-- 请填写您的应用私钥,例如:MIIEvQIBADANB ... ... -->");
alipayConfig.setAlipayPublicKey("<-- 请填写您的支付宝公钥,例如:MIIBIjANBg... -->");
defaultClient.setAlipayConfig(alipayConfig);
AlipayOpenMiniTipsDeliveryApi api = new AlipayOpenMiniTipsDeliveryApi();
String deliveryId = "20211114000003057595";
try {
AlipayOpenMiniTipsDeliveryQueryResponseModel response = api.query(deliveryId);
} catch (ApiException e) {
AlipayOpenMiniTipsDeliveryQueryDefaultResponse errorObject = (AlipayOpenMiniTipsDeliveryQueryDefaultResponse) e.getErrorObject();
System.out.println("调用失败:" + errorObject);
}
}
}
重要入参说明
响应示例
{
"start_time":"2021-11-11 14:31:13",
"delivery_content":"点击收藏,下次访问更方便",
"delivery_name":"收藏引导配置投放活动",
"delivery_id":"20211114000003057595",
"end_time":"2021-11-12 14:31:13",
"match_type":"TARGETURL",
"match_url":"/page/web",
"fail_reason":"当前文案语义不通顺,请修改",
"status":"WORKING"
}
响应参数
分页查询活动
示例代码
package com.java.sdk.demo;
import com.alipay.v3.ApiException;
import com.alipay.v3.ApiClient;
import com.alipay.v3.util.model.AlipayConfig;
import com.alipay.v3.Configuration;
import com.alipay.v3.api.AlipayOpenMiniTipsDeliveryApi;
import com.alipay.v3.model.*;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AlipayOpenMiniTipsDeliveryApiBatchquery {
public static void main(String[] args) throws ApiException {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// 初始化alipay参数(全局设置一次)
AlipayConfig alipayConfig = new AlipayConfig();
alipayConfig.setServerUrl("https://openapi.alipay.com");
alipayConfig.setAppId("<-- 请填写您的AppId,例如:2019091767145019 -->");
alipayConfig.setPrivateKey("<-- 请填写您的应用私钥,例如:MIIEvQIBADANB ... ... -->");
alipayConfig.setAlipayPublicKey("<-- 请填写您的支付宝公钥,例如:MIIBIjANBg... -->");
defaultClient.setAlipayConfig(alipayConfig);
AlipayOpenMiniTipsDeliveryApi api = new AlipayOpenMiniTipsDeliveryApi();
AlipayOpenMiniTipsDeliveryBatchqueryModel data = new AlipayOpenMiniTipsDeliveryBatchqueryModel();
data.setPageNumber("1");
data.setPageSize("5");
try {
AlipayOpenMiniTipsDeliveryBatchqueryResponseModel response = api.batchquery(data);
} catch (ApiException e) {
AlipayOpenMiniTipsDeliveryBatchqueryDefaultResponse errorObject = (AlipayOpenMiniTipsDeliveryBatchqueryDefaultResponse) e.getErrorObject();
System.out.println("调用失败:" + errorObject);
}
}
}
重要入参说明
响应示例
{
"tips_delivery_list":[
{
"start_time":"2021-11-11 14:31:13",
"delivery_content":"点击收藏,下次访问更方便",
"delivery_name":"首页收藏引导投放活动",
"delivery_id":"20211114000003057595",
"end_time":"2021-12-23 14:29:00",
"match_type":"TARGETURL",
"match_url":"/page/web",
"fail_reason":"当前文案语义不通顺,请修改",
"status":"WORKING"
}
],
"total_size":20,
"total_pages":1
}
响应参数
查询活动汇总数据
示例代码
package com.java.sdk.demo;
import com.alipay.v3.ApiException;
import com.alipay.v3.ApiClient;
import com.alipay.v3.util.model.AlipayConfig;
import com.alipay.v3.Configuration;
import com.alipay.v3.api.AlipayOpenMiniTipsStatisticApi;
import com.alipay.v3.model.*;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AlipayOpenMiniTipsStatisticApiQuery {
public static void main(String[] args) throws ApiException {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// 初始化alipay参数(全局设置一次)
AlipayConfig alipayConfig = new AlipayConfig();
alipayConfig.setServerUrl("https://openapi.alipay.com");
alipayConfig.setAppId("<-- 请填写您的AppId,例如:2019091767145019 -->");
alipayConfig.setPrivateKey("<-- 请填写您的应用私钥,例如:MIIEvQIBADANB ... ... -->");
alipayConfig.setAlipayPublicKey("<-- 请填写您的支付宝公钥,例如:MIIBIjANBg... -->");
defaultClient.setAlipayConfig(alipayConfig);
AlipayOpenMiniTipsStatisticApi api = new AlipayOpenMiniTipsStatisticApi();
String deliveryId = "20220308000000934758";
String queryType = "app";
String startDate = "20220322";
String endDate = "20220328";
try {
AlipayOpenMiniTipsStatisticQueryResponseModel response = api.query(deliveryId, queryType, startDate, endDate);
} catch (ApiException e) {
AlipayOpenMiniTipsStatisticQueryDefaultResponse errorObject = (AlipayOpenMiniTipsStatisticQueryDefaultResponse) e.getErrorObject();
System.out.println("调用失败:" + errorObject);
}
}
}
重要入参说明
响应示例
{
"app_collect_cnt":4798780,
"total_tips_expo_uv":2333900,
"tips_expo_uv":434000,
"delivery_content":"点击收藏,下次使用更方便",
"delivery_id":"2018092061468502",
"tips_collect_rate":"33.33",
"tips_collect_uv":440000,
"app_uv":3080000,
"total_app_uv":79980000,
"total_tips_collect_uv":5030000,
"total_app_collect_cnt":7800000,
"total_tips_collect_rate":"33.33"
}
响应参数
修改于 2023-11-21 05:43:04