说明:
该接口是开发者帮助线下商家修改广告内容,如修改的是线上的广告内容,需要先将线上广告内容下架,再修改,修改后操作上架,才能在支付宝钱包APP看到修改后的广告内容。运营位类型可以选择图片或H5。具体可以参考该接口文档【修改广告接口】
广告创建接口参考该贴:[url]https://openclub.alipay.com/read.php?tid=1082&fid=71[/url]
调用代码示例:
//alipay.marketing.cdp.advertise.modify(修改广告接口) public static void updateAd(){ DefaultAlipayClient aliClient = alipayclient(); AlipayMarketingCdpAdvertiseModifyRequest request = new AlipayMarketingCdpAdvertiseModifyRequest(); request.setBizContent( //行为地址。用户点击广告后,跳转URL地址, 协议必须为HTTPS。广告类型为PIC时,需要设置该值。对于类型为URL不生效 "{\"action_url\":\"https://weibo.com/\"," //从创建广告接口中返回 + "\"ad_id\":\"422039\"," //广告内容 + "\"content\":\"https://oalipay-dl-django.alicdn.com/rest/1.0/image?fileIds=kGSB9--MRcS87H6SCT1LXQAAACMAAQQD&zoom=original\"," + "\"height\":\"120\"}" ); try { AlipayMarketingCdpAdvertiseModifyResponse response = aliClient.execute(request); System.out.print(response.getBody()); } catch (AlipayApiException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
接口同步返回:
{"alipay_marketing_cdp_advertise_modify_response":{"code":"10000","msg":"Success"},"sign":"PK9mGX8uy3xfwRKygPxPCuf62YQU5JrdY4yDSn5dRhRcjtcTlzm8Gzv1yhnNXOhyITDzY6O8+rwPpSUqrQXT3VvS6dkMvEnoXsT5uKefRKX9PuvwbttN5Vc7Me57aPX9dReiBji4HgBVMI22gcugZ8mBTuNIecYNAAxiVcZjUFQ="}
注意点:
1.content,广告内容,该值获取参考该贴【图片上传接口】:[url]https://openclub.alipay.com/read.php?tid=4605[/url]
2.其它注意点我已经在代码中注明,参考代码注释
报错提供信息:
appid+接口名+调用接口时间,最好将本次请求的完整参数一并发过来
如果大家在测试过程中遇到问题欢迎在帖子下方追问,请按照标准方式提问