|
@@ -35,13 +35,14 @@ public class Test {
|
|
chromeOptions.addArguments("--no-sandbox");
|
|
chromeOptions.addArguments("--no-sandbox");
|
|
chromeOptions.addArguments("--disable-gpu");
|
|
chromeOptions.addArguments("--disable-gpu");
|
|
chromeOptions.addArguments("--window-size=1290,1080");
|
|
chromeOptions.addArguments("--window-size=1290,1080");
|
|
- chromeOptions.addArguments("--user-agent="+HttpUtils.USER_AGENT);
|
|
|
|
|
|
+ chromeOptions.addArguments("--user-agent=" + HttpUtils.USER_AGENT);
|
|
chromeOptions.setAcceptInsecureCerts(true);
|
|
chromeOptions.setAcceptInsecureCerts(true);
|
|
- webDriver.get(url); //获取登录页面
|
|
|
|
|
|
+ //获取登录页面
|
|
|
|
+ webDriver.get(url);
|
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
- for (Cookie cookie : webDriver.manage().getCookies()){
|
|
|
|
- BasicClientCookie ck = new BasicClientCookie(cookie.getName(),cookie.getValue());
|
|
|
|
|
|
+ for (Cookie cookie : webDriver.manage().getCookies()) {
|
|
|
|
+ BasicClientCookie ck = new BasicClientCookie(cookie.getName(), cookie.getValue());
|
|
ck.setDomain("ad.oceanengine.com");
|
|
ck.setDomain("ad.oceanengine.com");
|
|
// if (cookie.getDomain().startsWith(".")){
|
|
// if (cookie.getDomain().startsWith(".")){
|
|
// ck.setDomain(cookie.getDomain().substring(1));
|
|
// ck.setDomain(cookie.getDomain().substring(1));
|
|
@@ -52,89 +53,89 @@ public class Test {
|
|
ck.setExpiryDate(cookie.getExpiry());
|
|
ck.setExpiryDate(cookie.getExpiry());
|
|
ck.setPath(cookie.getPath());
|
|
ck.setPath(cookie.getPath());
|
|
HttpUtils.cookieStore.addCookie(ck);
|
|
HttpUtils.cookieStore.addCookie(ck);
|
|
- System.out.println(cookie.getName()+","+cookie.getValue()+","+cookie.getDomain());
|
|
|
|
|
|
+ System.out.println(cookie.getName() + "," + cookie.getValue() + "," + cookie.getDomain());
|
|
// ck.setDomain(".sso.toutiao.com");
|
|
// ck.setDomain(".sso.toutiao.com");
|
|
// HttpUtils.cookieStore.addCookie(ck);
|
|
// HttpUtils.cookieStore.addCookie(ck);
|
|
}
|
|
}
|
|
|
|
|
|
String html = webDriver.getPageSource();
|
|
String html = webDriver.getPageSource();
|
|
- Map<String,String> header = new HashMap<String,String>();
|
|
|
|
- header.put("Accept","*/*");
|
|
|
|
- header.put("Connection","keep-alive");
|
|
|
|
- header.put("Host","sso.toutiao.com");
|
|
|
|
- header.put("Content-Type","application/x-www-form-urlencoded");
|
|
|
|
- header.put("Origin","https://ad.oceanengine.com");
|
|
|
|
- header.put("Referer","https://ad.oceanengine.com/pages/login/index.html");
|
|
|
|
- Map<String,Object> param = new HashMap<String,Object>();
|
|
|
|
- param.put("mobile","");
|
|
|
|
- param.put("code","");
|
|
|
|
-// param.put("account","guoyanling@c-top.com.cn");
|
|
|
|
-// param.put("password","Hcstad-567");
|
|
|
|
- param.put("account","dcd_ad@bytedance.com");
|
|
|
|
- param.put("password","typdDCD@2018");
|
|
|
|
- param.put("captcha","hqde");
|
|
|
|
- param.put("is_30_days_no_login","true");
|
|
|
|
- param.put("service","https://ad.oceanengine.com");
|
|
|
|
- String res = HttpUtils.httpPostParamRequest("https://sso.toutiao.com/account_login/",param,header);
|
|
|
|
-// System.out.println(res);
|
|
|
|
-// Scanner scanner = new Scanner(System.in);
|
|
|
|
-// String code = scanner.nextLine();
|
|
|
|
-// param.put("captcha",code);
|
|
|
|
-// res = HttpUtils.httpPostParamRequest("https://sso.toutiao.com/account_login/",param,header);
|
|
|
|
-// System.out.println(res);
|
|
|
|
|
|
+ Map<String, String> header = new HashMap<String, String>();
|
|
|
|
+ header.put("Accept", "*/*");
|
|
|
|
+ header.put("Connection", "keep-alive");
|
|
|
|
+ header.put("Host", "sso.toutiao.com");
|
|
|
|
+ header.put("Content-Type", "application/x-www-form-urlencoded");
|
|
|
|
+ header.put("Origin", "https://ad.oceanengine.com");
|
|
|
|
+ header.put("Referer", "https://ad.oceanengine.com/pages/login/index.html");
|
|
|
|
+ Map<String, Object> param = new HashMap<String, Object>();
|
|
|
|
+ param.put("mobile", "");
|
|
|
|
+ param.put("code", "");
|
|
|
|
+/* param.put("account","guoyanling@c-top.com.cn");
|
|
|
|
+ param.put("password","Hcstad-567");*/
|
|
|
|
+ param.put("account", "dcd_ad@bytedance.com");
|
|
|
|
+ param.put("password", "typdDCD@2018");
|
|
|
|
+ param.put("captcha", "hqde");
|
|
|
|
+ param.put("is_30_days_no_login", "true");
|
|
|
|
+ param.put("service", "https://ad.oceanengine.com");
|
|
|
|
+ String res = HttpUtils.httpPostParamRequest("https://sso.toutiao.com/account_login/", param, header);
|
|
|
|
+/* System.out.println(res);
|
|
|
|
+ Scanner scanner = new Scanner(System.in);
|
|
|
|
+ String code = scanner.nextLine();
|
|
|
|
+ param.put("captcha",code);
|
|
|
|
+ res = HttpUtils.httpPostParamRequest("https://sso.toutiao.com/account_login/",param,header);
|
|
|
|
+ System.out.println(res);*/
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
|
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
|
JsonNode jsonNode = mapper.readTree(res);
|
|
JsonNode jsonNode = mapper.readTree(res);
|
|
Integer errorCode = jsonNode.get("error_code").asInt();
|
|
Integer errorCode = jsonNode.get("error_code").asInt();
|
|
String orderId = null;
|
|
String orderId = null;
|
|
- while(errorCode != 0){
|
|
|
|
|
|
+ while (errorCode != 0) {
|
|
FateadmUtil fateadmUtil = new FateadmUtil();
|
|
FateadmUtil fateadmUtil = new FateadmUtil();
|
|
fateadmUtil.init();
|
|
fateadmUtil.init();
|
|
- if(orderId != null){
|
|
|
|
|
|
+ if (orderId != null) {
|
|
fateadmUtil.Justice(orderId);
|
|
fateadmUtil.Justice(orderId);
|
|
}
|
|
}
|
|
String captcha = jsonNode.get("captcha").asText();
|
|
String captcha = jsonNode.get("captcha").asText();
|
|
- BASE64Decoder decoder =new BASE64Decoder();
|
|
|
|
- FateadmHttpUtil.HttpResp resp = fateadmUtil.Predict("30400",decoder.decodeBuffer(captcha));
|
|
|
|
- param.put("captcha",resp.pred_resl);
|
|
|
|
|
|
+ BASE64Decoder decoder = new BASE64Decoder();
|
|
|
|
+ FateadmHttpUtil.HttpResp resp = fateadmUtil.Predict("30400", decoder.decodeBuffer(captcha));
|
|
|
|
+ param.put("captcha", resp.pred_resl);
|
|
orderId = resp.req_id;
|
|
orderId = resp.req_id;
|
|
- res = HttpUtils.httpPostParamRequest("https://sso.toutiao.com/account_login/",param,header);
|
|
|
|
|
|
+ res = HttpUtils.httpPostParamRequest("https://sso.toutiao.com/account_login/", param, header);
|
|
System.out.println(res);
|
|
System.out.println(res);
|
|
jsonNode = mapper.readTree(res);
|
|
jsonNode = mapper.readTree(res);
|
|
errorCode = jsonNode.get("error_code").asInt();
|
|
errorCode = jsonNode.get("error_code").asInt();
|
|
}
|
|
}
|
|
- if(errorCode == 0){
|
|
|
|
|
|
+ if (errorCode == 0) {
|
|
// String redirectUrl = jsonNode.get("redirect_url").asText();
|
|
// String redirectUrl = jsonNode.get("redirect_url").asText();
|
|
// webDriver.get(redirectUrl);
|
|
// webDriver.get(redirectUrl);
|
|
String csrftoken = "";
|
|
String csrftoken = "";
|
|
List<org.apache.http.cookie.Cookie> cookies = HttpUtils.cookieStore.getCookies();
|
|
List<org.apache.http.cookie.Cookie> cookies = HttpUtils.cookieStore.getCookies();
|
|
- for(org.apache.http.cookie.Cookie ck : cookies){
|
|
|
|
- Cookie cookie = new Cookie(ck.getName(),ck.getValue(),"."+ck.getDomain(),ck.getPath(),ck.getExpiryDate());
|
|
|
|
|
|
+ for (org.apache.http.cookie.Cookie ck : cookies) {
|
|
|
|
+ Cookie cookie = new Cookie(ck.getName(), ck.getValue(), "." + ck.getDomain(), ck.getPath(), ck.getExpiryDate());
|
|
webDriver.manage().addCookie(cookie);
|
|
webDriver.manage().addCookie(cookie);
|
|
}
|
|
}
|
|
-
|
|
|
|
- webDriver.get("https://ad.oceanengine.com/pages/promotion.html#/ad");//登录成功 进入推广页面
|
|
|
|
-
|
|
|
|
- webDriver.get("https://ad.oceanengine.com/pages/campaign/create.html");//创建广告组页面
|
|
|
|
|
|
+ //登录成功 进入推广页面
|
|
|
|
+ webDriver.get("https://ad.oceanengine.com/pages/promotion.html#/ad");
|
|
|
|
+ //创建广告组页面
|
|
|
|
+ webDriver.get("https://ad.oceanengine.com/pages/campaign/create.html");
|
|
// HttpUtils.httpGetRequest("https://ad.toutiao.com/pages/promotion.html#/ad");
|
|
// HttpUtils.httpGetRequest("https://ad.toutiao.com/pages/promotion.html#/ad");
|
|
// HttpUtils.httpGetRequest("https://ad.toutiao.com/pages/campaign/create.html");
|
|
// HttpUtils.httpGetRequest("https://ad.toutiao.com/pages/campaign/create.html");
|
|
|
|
|
|
- Map<String,Object> param2 = new HashMap<String,Object>();
|
|
|
|
- Map<String,Object> param3 = new HashMap<String,Object>();
|
|
|
|
- param3.put("budget",0);
|
|
|
|
- param3.put("budget_mode",-1);
|
|
|
|
- param2.put("campaign_id","");
|
|
|
|
- param2.put("campaign_name","自动创建测试444444");
|
|
|
|
- param2.put("landing_type",3);
|
|
|
|
- param2.put("campaign_type",1);
|
|
|
|
- param2.put("budget",param3);
|
|
|
|
|
|
+ Map<String, Object> param2 = new HashMap<>();
|
|
|
|
+ Map<String, Object> param3 = new HashMap<>();
|
|
|
|
+ param3.put("budget", 0);
|
|
|
|
+ param3.put("budget_mode", -1);
|
|
|
|
+ param2.put("campaign_id", "");
|
|
|
|
+ param2.put("campaign_name", "自动创建测试444444");
|
|
|
|
+ param2.put("landing_type", 3);
|
|
|
|
+ param2.put("campaign_type", 1);
|
|
|
|
+ param2.put("budget", param3);
|
|
|
|
|
|
// webDriver.get("https://ad.toutiao.com/pages/campaign/create.html");
|
|
// webDriver.get("https://ad.toutiao.com/pages/campaign/create.html");
|
|
- for (Cookie cookie : webDriver.manage().getCookies()){
|
|
|
|
|
|
+ for (Cookie cookie : webDriver.manage().getCookies()) {
|
|
if ("csrftoken".equals(cookie.getName())) {
|
|
if ("csrftoken".equals(cookie.getName())) {
|
|
csrftoken = cookie.getValue();
|
|
csrftoken = cookie.getValue();
|
|
}
|
|
}
|
|
- BasicClientCookie ck = new BasicClientCookie(cookie.getName(),cookie.getValue());
|
|
|
|
|
|
+ BasicClientCookie ck = new BasicClientCookie(cookie.getName(), cookie.getValue());
|
|
// if (cookie.getDomain().startsWith(".")){
|
|
// if (cookie.getDomain().startsWith(".")){
|
|
// ck.setDomain(URLDecoder.decode(cookie.getDomain().substring(1),"utf-8"));
|
|
// ck.setDomain(URLDecoder.decode(cookie.getDomain().substring(1),"utf-8"));
|
|
// }else {
|
|
// }else {
|
|
@@ -144,85 +145,116 @@ public class Test {
|
|
ck.setExpiryDate(cookie.getExpiry());
|
|
ck.setExpiryDate(cookie.getExpiry());
|
|
ck.setPath(cookie.getPath());
|
|
ck.setPath(cookie.getPath());
|
|
HttpUtils.cookieStore.addCookie(ck);
|
|
HttpUtils.cookieStore.addCookie(ck);
|
|
- System.out.println(cookie.getName()+","+cookie.getValue()+","+cookie.getDomain());
|
|
|
|
|
|
+ System.out.println(cookie.getName() + "," + cookie.getValue() + "," + cookie.getDomain());
|
|
}
|
|
}
|
|
- header.put("Accept","application/json, text/javascript, */*; q=0.01");
|
|
|
|
- header.put("Connection","keep-alive");
|
|
|
|
- header.put("Host","ad.oceanengine.com");
|
|
|
|
- header.put("Content-Type","application/json");
|
|
|
|
- header.put("Origin","https://ad.oceanengine.com");
|
|
|
|
- header.put("X-CSRFToken",csrftoken);
|
|
|
|
- header.put("X-Requested-With","XMLHttpRequest");
|
|
|
|
- header.put("Referer","https://ad.oceanengine.com/pages/campaign/create.html");
|
|
|
|
- res = HttpUtils.httpPostRequest("https://ad.oceanengine.com/overture/campaign/create/",param2,header);// 创建广告组返回信息
|
|
|
|
|
|
+ header.put("Accept", "application/json, text/javascript, */*; q=0.01");
|
|
|
|
+ header.put("Connection", "keep-alive");
|
|
|
|
+ header.put("Host", "ad.oceanengine.com");
|
|
|
|
+ header.put("Content-Type", "application/json");
|
|
|
|
+ header.put("Origin", "https://ad.oceanengine.com");
|
|
|
|
+ header.put("X-CSRFToken", csrftoken);
|
|
|
|
+ header.put("X-Requested-With", "XMLHttpRequest");
|
|
|
|
+ header.put("Referer", "https://ad.oceanengine.com/pages/campaign/create.html");
|
|
|
|
+ // 创建广告组返回信息
|
|
|
|
+ res = HttpUtils.httpPostRequest("https://ad.oceanengine.com/overture/campaign/create/", param2, header);
|
|
System.out.println(res);
|
|
System.out.println(res);
|
|
JsonNode node = mapper.readTree(res);
|
|
JsonNode node = mapper.readTree(res);
|
|
//{"status": "fail", "msg": "\u5e7f\u544a\u7ec4\u4e0d\u80fd\u91cd\u590d", "type": "form_error", "name": "campaign_name"}
|
|
//{"status": "fail", "msg": "\u5e7f\u544a\u7ec4\u4e0d\u80fd\u91cd\u590d", "type": "form_error", "name": "campaign_name"}
|
|
- String campaignId = node.get("data").get("campaign_id").asText(); //广告组id
|
|
|
|
- String url2 = "https://ad.oceanengine.com/pages/ad/create.html?campaign_id="+campaignId+"&landing_type=3&temp_id=ADvQb";
|
|
|
|
|
|
+ //广告组id
|
|
|
|
+ String campaignId = node.get("data").get("campaign_id").asText();
|
|
|
|
+ String url2 = "https://ad.oceanengine.com/pages/ad/create.html?campaign_id=" + campaignId + "&landing_type=3&temp_id=ADvQb";
|
|
webDriver.get(url2);
|
|
webDriver.get(url2);
|
|
// webDriver.get("https://ad.toutiao.com/agent/get_agency/?advertiser_id=1634948959249411");
|
|
// webDriver.get("https://ad.toutiao.com/agent/get_agency/?advertiser_id=1634948959249411");
|
|
- header.put("Referer",url2);
|
|
|
|
- for (Cookie cookie : webDriver.manage().getCookies()){
|
|
|
|
- BasicClientCookie ck = new BasicClientCookie(cookie.getName(),cookie.getValue());
|
|
|
|
|
|
+ header.put("Referer", url2);
|
|
|
|
+ for (Cookie cookie : webDriver.manage().getCookies()) {
|
|
|
|
+ BasicClientCookie ck = new BasicClientCookie(cookie.getName(), cookie.getValue());
|
|
ck.setDomain("ad.oceanengine.com");
|
|
ck.setDomain("ad.oceanengine.com");
|
|
ck.setExpiryDate(cookie.getExpiry());
|
|
ck.setExpiryDate(cookie.getExpiry());
|
|
ck.setPath(cookie.getPath());
|
|
ck.setPath(cookie.getPath());
|
|
HttpUtils.cookieStore.addCookie(ck);
|
|
HttpUtils.cookieStore.addCookie(ck);
|
|
- System.out.println(cookie.getName()+","+cookie.getValue()+","+cookie.getDomain());
|
|
|
|
|
|
+ System.out.println(cookie.getName() + "," + cookie.getValue() + "," + cookie.getDomain());
|
|
}
|
|
}
|
|
String siteStr = HttpUtils.httpGetRequest("https://ad.oceanengine.com/overture/api/adv_site/get_site_list/?_=" + String.valueOf(System.currentTimeMillis()));
|
|
String siteStr = HttpUtils.httpGetRequest("https://ad.oceanengine.com/overture/api/adv_site/get_site_list/?_=" + String.valueOf(System.currentTimeMillis()));
|
|
String convStr = HttpUtils.httpGetRequest("https://ad.oceanengine.com/overture/api/get_tetris_action/?external_url=&type=external&pricing=9&landing_type=3&_=" + String.valueOf(System.currentTimeMillis()));
|
|
String convStr = HttpUtils.httpGetRequest("https://ad.oceanengine.com/overture/api/get_tetris_action/?external_url=&type=external&pricing=9&landing_type=3&_=" + String.valueOf(System.currentTimeMillis()));
|
|
JsonNode siteNode = mapper.readTree(siteStr);
|
|
JsonNode siteNode = mapper.readTree(siteStr);
|
|
JsonNode convNode = mapper.readTree(convStr);
|
|
JsonNode convNode = mapper.readTree(convStr);
|
|
|
|
|
|
- Map<String,Object> param4 = new HashMap<String,Object>();
|
|
|
|
- param4.put("location_type",4);
|
|
|
|
- param4.put("aweme_account_fans",0);
|
|
|
|
- String tokenStr = HttpUtils.httpPostRequest("https://ad.oceanengine.com/api/v1/hl/ad/audience/estimate/",param4,header);
|
|
|
|
|
|
+ Map<String, Object> param4 = new HashMap<String, Object>();
|
|
|
|
+ param4.put("location_type", 4);
|
|
|
|
+ param4.put("aweme_account_fans", 0);
|
|
|
|
+ String tokenStr = HttpUtils.httpPostRequest("https://ad.oceanengine.com/api/v1/hl/ad/audience/estimate/", param4, header);
|
|
System.out.println(siteStr);
|
|
System.out.println(siteStr);
|
|
System.out.println(convStr);
|
|
System.out.println(convStr);
|
|
System.out.println(tokenStr);
|
|
System.out.println(tokenStr);
|
|
JsonNode tokenNode = mapper.readTree(tokenStr);
|
|
JsonNode tokenNode = mapper.readTree(tokenStr);
|
|
- Map<String,Object> param5 = new HashMap<String,Object>();
|
|
|
|
- param5.put("delivery_range",1); // 投放范围
|
|
|
|
- param5.put("classify",5); //广告类别 5 内广
|
|
|
|
- param5.put("projectid","");
|
|
|
|
- param5.put("download_type",2); //下载方式 1下载链接 2包含下载链接的落地页
|
|
|
|
- param5.put("localGeolocation",new ArrayList<String>());
|
|
|
|
- param5.put("external_url","https://ad.oceanengine.com/tetris/page/"+siteNode.get("data").get(0).get("siteId").asText()); // 落地页链接
|
|
|
|
- param5.put("convert_id",convNode.get("action_data").get(0).get("id").asLong()); // 转换id
|
|
|
|
- param5.put("open_url",""); // 应用直达链接
|
|
|
|
- param5.put("style_type",0);
|
|
|
|
- param5.put("location_type",4); //受众位置类型
|
|
|
|
- param5.put("hide_if_exists",0); // 过滤已安装,当推广目标为安卓应用下载时可填,0表示不过滤,1表示过滤,默认为不过滤
|
|
|
|
- param5.put("interest_tag_mode",0); //兴趣分类
|
|
|
|
- param5.put("token",tokenNode.get("data").get("token").asText());
|
|
|
|
- param5.put("toutiao",100000005); //头条预估数据
|
|
|
|
- param5.put("aweme",150000005); //抖音预估数据
|
|
|
|
- param5.put("video_app",40000005);//西瓜预估数据
|
|
|
|
- param5.put("hotsoon",40000005); //火山预估数据
|
|
|
|
- param5.put("aweme_account_fans",0); //账号粉丝相似人群
|
|
|
|
- param5.put("auto_extend_enabled",0);// 智能放量????
|
|
|
|
- param5.put("budget_mode",0); // 广告预算类型 0 日预算 1 总预算
|
|
|
|
- param5.put("budget",300); //广告预算
|
|
|
|
- param5.put("schedule_type",1); //广告投放时间类型 默认1 1:不限 2:按时间???
|
|
|
|
- param5.put("start_time","2019-07-02 00:00"); //广告投放起始时间
|
|
|
|
- param5.put("end_time","2019-07-03 23:59");//广告投放结束时间
|
|
|
|
- param5.put("week_schedule",new ArrayList<String>()); //投放时段
|
|
|
|
- param5.put("week_time",new ArrayList<ArrayList<Integer>>());//投放时段
|
|
|
|
- param5.put("pricing",9); //计划出价类型 9 按展示付费 7 按点击付费 8 按转化付费
|
|
|
|
- param5.put("cpa_phrase",2); //出价为OCPC时,计划处于哪个阶段??
|
|
|
|
- param5.put("is_union_slot","");
|
|
|
|
- param5.put("hide_if_converted",1); //过滤已转化用户类型字段,只有转化为目标时可填 优化目标为转化才展示
|
|
|
|
- param5.put("flow_control_mode",0); //投放速度/投放方式使用字段
|
|
|
|
- param5.put("cpa_bid",1);
|
|
|
|
- param5.put("smart_bid_type",0); //自动出价类型,OCPM支持
|
|
|
|
- param5.put("adjust_cpa",0); //是否调整自动出价 允许值: "0", "1" 默认值: 0
|
|
|
|
- param5.put("app_bid_ratio",new Object());
|
|
|
|
- param5.put("name","自动创建测试4"); //广计划名称
|
|
|
|
- param5.put("campaign_id",campaignId);
|
|
|
|
- String createResult = HttpUtils.httpPostRequest("https://ad.oceanengine.com/overture/ad/create/",param5,header);
|
|
|
|
|
|
+ Map<String, Object> param5 = new HashMap<String, Object>();
|
|
|
|
+ // 投放范围
|
|
|
|
+ param5.put("delivery_range", 1);
|
|
|
|
+ //广告类别 5 内广
|
|
|
|
+ param5.put("classify", 5);
|
|
|
|
+ param5.put("projectid", "");
|
|
|
|
+ //下载方式 1下载链接 2包含下载链接的落地页
|
|
|
|
+ param5.put("download_type", 2);
|
|
|
|
+ param5.put("localGeolocation", new ArrayList<String>());
|
|
|
|
+ // 落地页链接
|
|
|
|
+ param5.put("external_url", "https://ad.oceanengine.com/tetris/page/" + siteNode.get("data").get(0).get("siteId").asText());
|
|
|
|
+ // 转换id
|
|
|
|
+ param5.put("convert_id", convNode.get("action_data").get(0).get("id").asLong());
|
|
|
|
+ // 应用直达链接
|
|
|
|
+ param5.put("open_url", "");
|
|
|
|
+ param5.put("style_type", 0);
|
|
|
|
+ //受众位置类型
|
|
|
|
+ param5.put("location_type", 4);
|
|
|
|
+ // 过滤已安装,当推广目标为安卓应用下载时可填,0表示不过滤,1表示过滤,默认为不过滤
|
|
|
|
+ param5.put("hide_if_exists", 0);
|
|
|
|
+ //兴趣分类
|
|
|
|
+ param5.put("interest_tag_mode", 0);
|
|
|
|
+ param5.put("token", tokenNode.get("data").get("token").asText());
|
|
|
|
+ //头条预估数据
|
|
|
|
+ param5.put("toutiao", 100000005);
|
|
|
|
+ //抖音预估数据
|
|
|
|
+ param5.put("aweme", 150000005);
|
|
|
|
+ //西瓜预估数据
|
|
|
|
+ param5.put("video_app", 40000005);
|
|
|
|
+ //火山预估数据
|
|
|
|
+ param5.put("hotsoon", 40000005);
|
|
|
|
+ //账号粉丝相似人群
|
|
|
|
+ param5.put("aweme_account_fans", 0);
|
|
|
|
+ // 智能放量????
|
|
|
|
+ param5.put("auto_extend_enabled", 0);
|
|
|
|
+ // 广告预算类型 0 日预算 1 总预算
|
|
|
|
+ param5.put("budget_mode", 0);
|
|
|
|
+ //广告预算
|
|
|
|
+ param5.put("budget", 300);
|
|
|
|
+ //广告投放时间类型 默认1 1:不限 2:按时间???
|
|
|
|
+ param5.put("schedule_type", 1);
|
|
|
|
+ //广告投放起始时间
|
|
|
|
+ param5.put("start_time", "2019-07-02 00:00");
|
|
|
|
+ //广告投放结束时间
|
|
|
|
+ param5.put("end_time", "2019-07-03 23:59");
|
|
|
|
+ //投放时段
|
|
|
|
+ param5.put("week_schedule", new ArrayList<String>());
|
|
|
|
+ //投放时段
|
|
|
|
+ param5.put("week_time", new ArrayList<ArrayList<Integer>>());
|
|
|
|
+ //计划出价类型 9 按展示付费 7 按点击付费 8 按转化付费
|
|
|
|
+ param5.put("pricing", 9);
|
|
|
|
+ //出价为OCPC时,计划处于哪个阶段??
|
|
|
|
+ param5.put("cpa_phrase", 2);
|
|
|
|
+ param5.put("is_union_slot", "");
|
|
|
|
+ //过滤已转化用户类型字段,只有转化为目标时可填 优化目标为转化才展示
|
|
|
|
+ param5.put("hide_if_converted", 1);
|
|
|
|
+ //投放速度/投放方式使用字段
|
|
|
|
+ param5.put("flow_control_mode", 0);
|
|
|
|
+ param5.put("cpa_bid", 1);
|
|
|
|
+ //自动出价类型,OCPM支持
|
|
|
|
+ param5.put("smart_bid_type", 0);
|
|
|
|
+ //是否调整自动出价 允许值: "0", "1" 默认值: 0
|
|
|
|
+ param5.put("adjust_cpa", 0);
|
|
|
|
+ param5.put("app_bid_ratio", new Object());
|
|
|
|
+ //广计划名称
|
|
|
|
+ param5.put("name", "自动创建测试4");
|
|
|
|
+ param5.put("campaign_id", campaignId);
|
|
|
|
+ String createResult = HttpUtils.httpPostRequest("https://ad.oceanengine.com/overture/ad/create/", param5, header);
|
|
System.out.println(createResult);
|
|
System.out.println(createResult);
|
|
}
|
|
}
|
|
// webDriver.close();
|
|
// webDriver.close();
|