说明
本帖是测试营销活动送红包的现金活动列表查询和现金活动详情查询接口,本帖是使用沙箱环境测试的,仅供参考!!
是否需要签约:需要,【如何签约】
是否支持沙箱环境:支持
接口文档: 现金活动列表查询文档,现金活动详情查询文档
sdk下载:下载
营销活动送红包沙箱Java版demo:download:营销活动送红包Java版.zip
接口调试
1.1现金活动详情查询请求示例代码:
AlipayClient alipayClient = new DefaultAlipayClient(AlipayConfig.URL ,AlipayConfig.APPID,AlipayConfig.RSA_PRIVATE_KEY,"json",AlipayConfig.CHARSET,AlipayConfig.ALIPAY_PUBLIC_KEY,AlipayConfig.Sign_Type); AlipayMarketingCampaignCashDetailQueryRequest request = new AlipayMarketingCampaignCashDetailQueryRequest(); request.setBizContent("{" + ""crowd_no":"ytn7dvcdDr4ZppanSialdE6zaP6FAl46POVbeB41ad7MnSZ96O-zxUfKlHp5cxmx"" + "}"); AlipayMarketingCampaignCashDetailQueryResponse response = alipayClient.execute(request); if(response.isSuccess()){ System.out.println("调用成功"); } else { System.out.println("调用失败"); } System.out.println(response.getBody());//打印完整的响应报文信息 }
1.2现金活动详情查询请求成功返回信息示例:
调用成功 {"alipay_marketing_campaign_cash_detail_query_response":{"code":"10000","msg":"Success","camp_status":"CLOSED","coupon_name":"煜雨创建营销活动送红包","crowd_no":"ytn7dvcdDr4ZppanSialdE6zaP6FAl46POVbeB41ad7MnSZ96O-zxUfKlHp5cxmx","end_time":"2018-05-29 22:48:30","origin_crowd_no":"20180508199410190701192600293004","prize_msg":"煜雨小哥哥在测试","prize_type":"random","send_amount":"0.02","start_time":"2018-05-08 19:10:19","total_amount":"2.90"},"XXX"}
2.1现金活动列表查询请求示例代码:
AlipayClient alipayClient = new DefaultAlipayClient(AlipayConfig.URL ,AlipayConfig.APPID,AlipayConfig.RSA_PRIVATE_KEY,"json",AlipayConfig.CHARSET,AlipayConfig.ALIPAY_PUBLIC_KEY,"RSA2"); AlipayMarketingCampaignCashListQueryRequest request = new AlipayMarketingCampaignCashListQueryRequest(); request.setBizContent("{" + ""camp_status":"ALL"," + //要查询的活动状态,不填默认返回所有类型。 可填: ALL:所有类型的活动 CREATED: 已创建未打款 PAID:已打款 READY:活动已开始 PAUSE:活动已暂停 CLOSED:活动已结束 SETTLE:活动已清算 ""page_size":"10"," + ""page_index":"1"" + " }"); AlipayMarketingCampaignCashListQueryResponse response = alipayClient.execute(request); if(response.isSuccess()){ System.out.println("调用成功"); } else { System.out.println("调用失败"); } System.out.println(response.getBody());//打印完整的响应报文信息 }
2.2现金活动列表查询请求成功返回信息示例:
调用成功 {"alipay_marketing_campaign_cash_list_query_response":{"code":"10000","msg":"Success","camp_list":[{"camp_status":"CLOSED","coupon_name":"煜雨创建营销活动送红包","crowd_no":"ytn7dvcdDr4ZppanSialdE6zaP6FAl46POVbeB41ad7MnSZ96O-zxUfKlHp5cxmx","origin_crowd_no":"20180508199410190701192600293004"},{"camp_status":"CLOSED","coupon_name":"煜雨创建营销活动送红包","crowd_no":"ytn7dvcdDr4ZppanSialdOcIA8xg4-BhoUcNjxy6nsXMnSZ96O-zxUfKlHp5cxmx","origin_crowd_no":"20180508199410190701192606860004"}],"page_index":"1","page_size":"10","total_size":"2"},"sign":"XXX"}
参数说明
1>.crowd_no参数值是通过创建现金活动接口获取
2>.camp_status参数不设置默认返回所有类型
正确的提问方式:
appid+使用环境(正式/沙箱)+调用接口时间+请求参数(提供信息不完整不回复,谢谢配合)
如果您在接入该接口还有疑问欢迎在本帖下方追问吐槽