说明: 本帖是测试营销活动创建口令送活动,首先要创建口碑门店,本帖是沙箱环境测试,仅供参考!!
是否支持沙箱环境:支持
接口文档:查看
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"); KoubeiMarketingCampaignActivityCreateRequest request = new KoubeiMarketingCampaignActivityCreateRequest(); request.setBizContent("{" + ""out_biz_no":"11114554555"," + ""name":"煜雨口令送"," + ""start_time":"2018-07-02 00:05:00"," + ""end_time":"2018-08-01 00:00:00"," + ""type":"GUESS_SEND"," + ""constraint_info":{" + ""suit_shops":["2017120300077000000046770679"]," + ""item_ids":["212313","221322"]" + "}," + ""promo_tools":[{" + ""voucher":{" + ""type":"MONEY"," + //代金券 ""multi_use_mode":"NO_MULTI"," + //券叠加的属性 ""name":"煜雨发送口令送"," + ""brand_name":"煜雨发送口令送副标题"," + ""use_instructions":["煜雨发送口令送的使用说明"]," + ""logo":"cMHmLkQ9Tcmmgl6eNRH_KgAAACMAAQED"," + ""worth_value":"0.01"," + ""validate_type":"FIXED"," + //券有效期类型 ""start_time":"2018-07-02 00:09:00"," + ""end_time":"2018-08-02 00:00:00"," + ""use_rule":{"suit_shops":["2017120300077000000046770679"],"min_consume":"0.01"}," + //消费送活动最低消费不能为空 ""effect_type":"IMMEDIATELY"" + //券生效的方式,目前支持以下方式 立即生效:IMMEDIATELY 延迟生效:DELAY 仅在券有效期类型为相对有效期时生效 "}," + ""send_rule":{"min_cost":"1"}" + "}]," + ""recruit_tool":{" + ""start_time":"2018-07-02 12:00:00"," + ""end_time":"2018-08-06 12:00:00"," + ""pid_shops":[{"pid":"2088522421611655"}]" + "}," + ""publish_channels":[{"+ ""type":"MERCHANT_CROWD","+ ""name":"口令送","+ ""config":"{"PASSWORD":"2512323113","BACKGROUND_LOGO":"_IzFdPChQ5GMjHkzonA1ggAAACMAAQED"}"" + "}]"+ "}"); KoubeiMarketingCampaignActivityCreateResponse response = alipayClient.execute(request); if(response.isSuccess()){ System.out.println("口令送代金券调用成功"); } else { System.out.println("口令送代金券调用失败"); } System.out.println(response.getBody());//打印完整的响应报文信息
2.请求成功返回信息
口令送代金券调用成功 {"koubei_marketing_campaign_activity_create_response":{"code":"10000","msg":"Success","camp_id":"20180315000000002603053000151658","camp_status":"STARTED"},"sign":"XXX"}
3.如何领取口令送活动优惠:https://openclub.alipay.com/club/history/read/7616
4.注意事项:
1>.口令送活动的投放渠道只能设置为口令送(publish_channels中的type只能设置为MERCHANT_CROWD),否则报错提示:AE0311111201:口令送活动的投放渠道只能设置为口令送
口令送代金券调用失败 {"koubei_marketing_campaign_activity_create_response":{"code":"40004","msg":"Business Failed","sub_code":"BIZ_INVOKE_ERROR","sub_msg":"AE0311111201:口令送活动的投放渠道只能设置为口令送"},"sign":"XXX"}
2>.口令送活动间隔(start_time和end_time)不能大于60天,否则报错提示:口令送活动间隔不大于60
口令送代金券调用失败 {"koubei_marketing_campaign_activity_create_response":{"code":"40004","msg":"Business Failed","sub_code":"BIZ_INVOKE_ERROR","sub_msg":"口令送活动间隔不大于60"},"sign":"XXX"}
正确的提问方式:
appid+使用环境(正式/沙箱)+调用接口时间+请求参数(提供信息不完整不回复,谢谢配合)
如果您在接入该接口还有疑问欢迎在本帖下方追问吐槽