* Key1:xdTitle, value:取浮层标题维护的内容 *
* Key2:xdContent, value:取浮层内容里面添加的内容:文本+变量"); appMsg.setNotifyType("0"); appMsg.setReceiverType("0"); appMsg.setRemark("备注"); appMsg.setTemplet("1"); appMsg.setTitle("签到提醒"); appMsg.setValidityDay("15"); request.setAppMsg(appMsg); request.setMsgSceneCode("Y00370"); request.setSnUnionId("69b75ba05b81eab12fa13eeda5da69b75ba1c5b81eab92fa"); WxMiniProMsg wxMiniProMsg= new WxMiniProMsg(); wxMiniProMsg.setAppId("testApp"); wxMiniProMsg.setDeviceVersion("设备版本号"); wxMiniProMsg.setMsgContent("消息模板内容"); wxMiniProMsg.setPageUrl("微信小程序内跳转链接地址"); wxMiniProMsg.setSceneCode("0"); wxMiniProMsg.setTempleId("zWiU8DFaL9f14EygPRSyo8ASVaDP-llc60LvUgXNKi8"); request.setWxMiniProMsg(wxMiniProMsg); //api入参校验逻辑开关,当测试稳定之后建议设置为 false 或者删除该行 request.setCheckParam(true); String serverUrl = "https://openpre.cnsuning.com/api/http/sopRequest"; String appKey = "你的appKey"; String appSecret = "你的appSecret"; DefaultSuningClient client = new DefaultSuningClient(serverUrl, appKey,appSecret, "json"); try { MsgPushCreateResponse response = client.excute(request); System.out.println("返回json/xml格式数据 :" + response.getBody()); } catch (SuningApiException e) { e.printStackTrace(); }
* Key2:xdContent, value:取浮层内容里面添加的内容:文本+变量"); $appMsg-> setNotifyType("0"); $appMsg-> setReceiverType("0"); $appMsg-> setRemark("备注"); $appMsg-> setTemplet("1"); $appMsg-> setTitle("签到提醒"); $appMsg-> setValidityDay("15"); $req -> setAppMsg($appMsg); $req -> setMsgSceneCode("Y00370"); $req -> setSnUnionId("69b75ba05b81eab12fa13eeda5da69b75ba1c5b81eab92fa"); $wxMiniProMsg= new WxMiniProMsg(); $wxMiniProMsg-> setAppId("testApp"); $wxMiniProMsg-> setDeviceVersion("设备版本号"); $wxMiniProMsg-> setMsgContent("消息模板内容"); $wxMiniProMsg-> setPageUrl("微信小程序内跳转链接地址"); $wxMiniProMsg-> setSceneCode("0"); $wxMiniProMsg-> setTempleId("zWiU8DFaL9f14EygPRSyo8ASVaDP-llc60LvUgXNKi8"); $req -> setWxMiniProMsg($wxMiniProMsg); //api入参校验逻辑开关,当测试稳定之后建议设置为 false 或者删除该行 $req -> setCheckParam('true'); $serverUrl = "https://openpre.cnsuning.com/api/http/sopRequest"; $appKey = "你的appKey"; $appSecret = "你的appSecret"; $client = new DefaultSuningClient($serverUrl,$appKey,$appSecret,'json'); $resp = $client -> execute($req); print_r("返回响应报文:".$resp);
* Key2:xdContent, value:取浮层内容里面添加的内容:文本+变量"; appMsg.notifyType="0"; appMsg.receiverType="0"; appMsg.remark="备注"; appMsg.templet="1"; appMsg.title="签到提醒"; appMsg.validityDay="15"; request.appMsg=appMsg; request.msgSceneCode="Y00370"; request.snUnionId="69b75ba05b81eab12fa13eeda5da69b75ba1c5b81eab92fa"; MsgPushCreateWxMiniProMsgReq wxMiniProMsg= new MsgPushCreateWxMiniProMsgReq(); wxMiniProMsg.appId="testApp"; wxMiniProMsg.deviceVersion="设备版本号"; wxMiniProMsg.msgContent="消息模板内容"; wxMiniProMsg.pageUrl="微信小程序内跳转链接地址"; wxMiniProMsg.sceneCode="0"; wxMiniProMsg.templeId="zWiU8DFaL9f14EygPRSyo8ASVaDP-llc60LvUgXNKi8"; request.wxMiniProMsg=wxMiniProMsg; //开启日志调试,当测试稳定之后建议设置为 false 或者删除该行 SuningLogger.IsLogDebug = true; string serverUrl = "https://openpre.cnsuning.com/api/http/sopRequest"; string appKey = "你的appKey"; string appSecret = "你的appSecret"; ISuningClient client = new DefaultSuningClient(serverUrl, appKey,appSecret); MsgPushCreateResponse response = client.Execute(request);
* Key2:xdContent, value:取浮层内容里面添加的内容:文本+变量", notifyType:"0", receiverType:"0", remark:"备注", templet:"1", title:"签到提醒", validityDay:"15", }; request.msgSceneCode="Y00370"; request.snUnionId="69b75ba05b81eab12fa13eeda5da69b75ba1c5b81eab92fa"; request. wxMiniProMsg= { appId:"testApp", deviceVersion:"设备版本号", msgContent:"消息模板内容", pageUrl:"微信小程序内跳转链接地址", sceneCode:"0", templeId:"zWiU8DFaL9f14EygPRSyo8ASVaDP-llc60LvUgXNKi8", }; domain = "https://openpre.cnsuning.com" appKey = "你的appKey" appSecret = "你的appSecret" request.setDomainInfo(domain,"80") request.setAppInfo(appKey,appSecret) try: result=request.getResponse() print(result) except Exception as e: print(e)