说明:
该接口主要用于创建之后的会员卡的模板修改,官方接口文档请点击【会员卡模板修改】
创建模板接口请参考我的这个帖子:[url]https://openclub.alipay.com/read.php?tid=1577&fid=71[/url]
接口调用示例:
//alipay.marketing.card.template.modify (会员卡模板修改) public static void template_modify(){ AlipayClient alipayClient=alipayclient(); AlipayMarketingCardTemplateModifyRequest request = new AlipayMarketingCardTemplateModifyRequest(); request.setBizContent("{" + //该参数每次调用都有修改一次,不然显示调用成功,实际没有效果展示 "\"request_id\":\"201607210000000000140001\"," + //这里取值的是创建接口返回的template_id "\"template_id\":\"20180131000000000782698000300330\"," + "\"biz_no_prefix\":\"prex\"," + "\"write_off_type\":\"text\"," + "\"template_style_info\":{" + "\"card_show_name\":\"颠覆白的黑模板修改\"," + "\"logo_id\":\"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC\"," + "\"color\":\"rgb(255,0,0)\"," + //红色 "\"background_id\":\"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC\"," + "\"bg_color\":\"rgb(255,255,0)\"," + //黄色 " \"feature_descriptions\":[" + " \"测试修改展示\"" + " ]," + "\"slogan\":\"测试测试测试\"," + "\"slogan_img_id\":\"1T8Pp00AT7eo9NoAJkMR3AAAACMAAQEC\"," + "\"brand_name\":\"可乐\"" + " }," + " \"template_benefit_info\":[{" + " \"title\":\"消费即折扣\"," + " \"benefit_desc\":[" + " \"消费即折扣\"" + " ]," + "\"start_date\":\"2016-07-18 15:17:23\"," + "\"end_date\":\"2022-07-34 12:12:12\"" + " }]," + " \"column_info_list\":[{" + " \"code\":\"BENEFIT_INFO\"," + "\"more_info\":{" + "\"title\":\"会员专享权益001\"," + "\"url\":\"http://www.baidu.com\"," + "\"params\":\"{}\"," + " \"descs\":[" + " \"会员生日7折\"" + " ]" + " }," + "\"title\":\"会员专享\"," + "\"operate_type\":\"openNative\"," + "\"value\":\"190\"" + " }]," + " \"field_rule_list\":[{" + " \"field_name\":\"Balance\"," + "\"rule_name\":\"ASSIGN_FROM_REQUEST\"," + "\"rule_value\":\"Balance\"" + "}]," + "\"shop_ids\":[" + "\"2016083000077000000018269663\"" + "]" + " }"); AlipayMarketingCardTemplateModifyResponse response = null; try { response = alipayClient.execute(request); System.out.println(response.getBody()); } catch (AlipayApiException e) { // TODO Auto-generated catch block e.printStackTrace(); } if(response.isSuccess()){ System.out.println("调用成功"); } else { System.out.println("调用失败"); } }
接口同步返回:
{"alipay_marketing_card_template_modify_response":{"code":"10000","msg":"Success","template_id":"20180131000000000782698000300330"},"sign":"IF5FnUdSn6zggkhzTsoZrPeP7VFOOYC5k8yzoB5peR3xFK4Y9MD0m5PUAE+6aIH2UlFqHKhnyLhl9g0/eD6zNalW9ruyDAtSndEGt8MV/aSsaIPOluCSuJz2z5pluvV7A+LcAKvkcZxoBDYRc3+BdBu027161ClAbFNcyWY3GY4="}
注意点:
1.request_id为唯一请求标识,每次请求都要不一样,我代码示例里有说明
2.template_id这个值一定要是你创建接口返回的值,不要弄混淆了
报错提供信息:
appid+接口名+调用接口时间,最好将本次请求的完整参数一并发过来
如果大家在测试过程中遇到问题欢迎在帖子下方追问,请按照标准方式提问