说明: 本帖是测试活动详情查询,只能查询到通过接口创建的营销活动的信息,首先要创建口碑门店
测试环境:JAVA1.5+,eclipse 是否支持沙箱环境:支持
接口文档:查看
sdk下载:下载
沙箱Java版营销活动demo:download:营销活动Java版.zip
1.代码请求示例:
AlipayClient alipayClient = new DefaultAlipayClient(AlipayConfig.URL ,AlipayConfig.APPID,AlipayConfig.RSA_PRIVATE_KEY,"json",AlipayConfig.CHARSET,AlipayConfig.ALIPAY_PUBLIC_KEY,"RSA2");
KoubeiMarketingCampaignActivityQueryRequest request = new KoubeiMarketingCampaignActivityQueryRequest();
request.setBizContent("{" +
"\\"camp_id\\":\\"20180904000000002995155000151659\\"," +
"\\"operator_id\\":\\"2088522421611655\\"," +
"\\"operator_type\\":\\"MER\\"" +
" }");
KoubeiMarketingCampaignActivityQueryResponse response = alipayClient.execute(request);
if(response.isSuccess()){
System.out.println("调用成功");
} else {
System.out.println("调用失败");
}
System.out.println(response.getBody());
2.请求成功返回信息示例
调用成功 {"koubei_marketing_campaign_activity_query_response":{"code":"10000","msg":"Success","camp_detail":{"activity_orders":[{"creator_id":"2088522421611655","creator_type":"MER","order_id":"20180106000000008411599000155658","order_status":"SUCCESS","order_type":"CAMPAIGN_CLOSE_ORDER"},{"creator_id":"mpromocenter-49-5018","creator_type":"SYSTEM","order_id":"20180105000000008528807000155655","order_status":"SUCCESS","order_type":"CAMPAIGN_ENABLE_ORDER"},{"creator_id":"2088522421611655","creator_type":"MER","order_id":"20180105000000008527826000155652","order_status":"SUCCESS","order_type":"CAMPAIGN_CREATE_ORDER"}],"auto_delay_flag":"N","constraint_info":{"item_ids":["212313","221322"],"suit_shops":["2017120400077000000046739305","2017120300077000000046770679","2017120100077000000046705826"]},"end_time":"2018-02-01 00:00:00","ext_info":"{\\"CAMPAIGN_REGION_SUMMARY\\":\\"\\",\\"ENABLED_TRIGGER_TYPE\\":\\"AUTO\\",\\"OFFLINE_REASON\\":\\"下架原因\\",\\"STARTED_TRIGGER_TYPE\\":\\"AUTO\\",\\"isv_app_id\\":\\"2017072607905647\\",\\"usagedEnv\\":\\"PROD\\"}","id":"20180105000000002287247000151656","name":"煜雨消费满10元送1元代金券","promo_tools":[{"send_rule":{"min_cost":"1","send_budget":"1234","send_num":"1"},"status":"STARTED","voucher":{"brand_name":"煜雨发送代金券副标题","donate_flag":"true","effect_type":"IMMEDIATELY","end_time":"2018-02-01 00:00:00","ext_info":"{\\"voucher_template_id\\":\\"20180105000730016511000US2X2\\"}","logo":"05IzyukmQxygZ3OXjQl86AAAACMAAQQD","multi_use_mode":"NO_MULTI","name":"煜雨发送代金券","start_time":"2018-01-05 00:00:00","type":"MONEY","use_instructions":["煜雨发送代金券的使用说明"],"use_rule":{"min_consume":"10","suit_shops":["2017120400077000000046739305","2017120300077000000046770679","2017120100077000000046705826"]},"validate_type":"FIXED","worth_value":"10"},"voucher_no":"571e1f2fe6534a7c813c6886f44f431d"}],"start_time":"2018-01-05 00:00:00","status":"CLOSED","type":"CONSUME_SEND"}},"sign":"XXX"}
3.注意事项:
2>.operator_id是操作人id,必须和operator_type配对出现,不填时默认是商户自己
3>.operator_type是是操作人id,MER(外部商户),MER_OPERATOR(外部商户操作员),PROVIDER(外部服务 商), PROVIDER_STAFF(外部服务商员工),默认不需要填这个字段,默认为MER
4.报错示例
1>.若operator_type设置为MER,但是operator_id设置的不是商户自己的pid,则报错“非法访问,权限不足”
调用失败 {"koubei_marketing_campaign_activity_query_response":{"code":"40004","msg":"Business Failed","sub_code":"REQ_PARAM_ERROR","sub_msg":"非法访问,权限不足"},"sign":"XXX"}
2>.operator_type设置为PROVIDER、PROVIDER_STAFF时,设置的operator_id没有对应的权限时则报错“代运营关系校验错误”
调用失败 {"koubei_marketing_campaign_activity_query_response":{"code":"40004","msg":"Business Failed","sub_code":"OPERATOR_RELATION_INVALID","sub_msg":"代运营关系校验错误"},"sign":"XXX"}
5.提问:
请按照appid+使用环境(正式/沙箱)+调用接口时间,最好将本次请求的完整参数一并发过来
如有其它问题,欢迎论坛评论留言,如有不足之处也欢迎多多吐槽