登录
退出
首页
开放版图
苏宁有货
商家后台
文档中心
文档中心
API文档
消息中心
平台公告
工单
我的工单
提交工单
控制台
SDK调用示例
suning.advertise.channel.add/
调用示例(JAVA)
复制全部代码
import com.suning.api.entity.advertise.ChannelAddRequest; import com.suning.api.entity.advertise.ChannelAddResponse; ChannelAddRequest request = new ChannelAddRequest(); MediaInputs mediaInputs= new MediaInputs(); mediaInputs.setAddress("玄武大道1号"); mediaInputs.setAreaName("玄武区"); mediaInputs.setBuildingNumber("50"); mediaInputs.setBusinessHours("12"); mediaInputs.setCategoryCode("AdPosition_SmallShop_Type_video2"); mediaInputs.setCityName("南京市"); mediaInputs.setContractNumber("SN12239991"); mediaInputs.setCoverNumber("10000"); mediaInputs.setCpmPrice("100.01"); mediaInputs.setCptMaxPlayTimes("100"); mediaInputs.setCptMediaMode("1"); mediaInputs.setCptPlayTimes("200"); mediaInputs.setCptPrice("100.01"); mediaInputs.setCptPublishDates("1,2,3,4,5"); mediaInputs.setCptSalesTimes("300"); mediaInputs.setDetailedLocation("紫金嘉悦东大门门口"); mediaInputs.setDuration("day"); mediaInputs.setFloor("3F"); mediaInputs.setFloorSpace("40.15"); mediaInputs.setHeight("10.11"); mediaInputs.setIsVertical("1"); mediaInputs.setIsVoice("1"); mediaInputs.setLatitude("26.068504"); mediaInputs.setLength("10.11"); mediaInputs.setLongitude("119.292912"); mediaInputs.setMaterialSize("100*100*100"); mediaInputs.setMaterialTime("15"); mediaInputs.setMediaId("98N7"); mediaInputs.setMediaNumber("50"); mediaInputs.setMediaPicture("http://www.suning.com/1,jpg"); mediaInputs.setMediaPlayDuration("5|15|30|60"); mediaInputs.setOperate("0"); mediaInputs.setParkingSpace("110"); mediaInputs.setPassengerNumber("1000000"); mediaInputs.setPrice("150.66"); mediaInputs.setProhibitedContent("医药类"); mediaInputs.setPropertyCosts("100.98"); mediaInputs.setProvinceName("江苏省"); mediaInputs.setRemarks("这是电子屏"); mediaInputs.setResolution("1920X1080"); mediaInputs.setSalesType("1"); mediaInputs.setScreenPosition("1|2|3|4|5"); mediaInputs.setSenceId("1001"); mediaInputs.setShopName("紫金嘉悦"); mediaInputs.setShopNumber("5"); mediaInputs.setShopProperty("性质属性"); mediaInputs.setShowPosition("1"); mediaInputs.setStoreTypes("19"); mediaInputs.setUnitCount("10"); mediaInputs.setUnitNumber("3"); mediaInputs.setWidth("10.11"); List
mediaInputsList =new ArrayList
(); mediaInputsList.add(mediaInputs); request.setMediaInputs(mediaInputsList); request.setStoreType("19"); //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 { ChannelAddResponse response = client.excute(request); System.out.println("返回json/xml格式数据 :" + response.getBody()); } catch (SuningApiException e) { e.printStackTrace(); }
调用示例(PHP)
复制全部代码
$req = new ChannelAddRequest(); $mediaInputs= new MediaInputs(); $mediaInputs-> setAddress("玄武大道1号"); $mediaInputs-> setAreaName("玄武区"); $mediaInputs-> setBuildingNumber("50"); $mediaInputs-> setBusinessHours("12"); $mediaInputs-> setCategoryCode("AdPosition_SmallShop_Type_video2"); $mediaInputs-> setCityName("南京市"); $mediaInputs-> setContractNumber("SN12239991"); $mediaInputs-> setCoverNumber("10000"); $mediaInputs-> setCpmPrice("100.01"); $mediaInputs-> setCptMaxPlayTimes("100"); $mediaInputs-> setCptMediaMode("1"); $mediaInputs-> setCptPlayTimes("200"); $mediaInputs-> setCptPrice("100.01"); $mediaInputs-> setCptPublishDates("1,2,3,4,5"); $mediaInputs-> setCptSalesTimes("300"); $mediaInputs-> setDetailedLocation("紫金嘉悦东大门门口"); $mediaInputs-> setDuration("day"); $mediaInputs-> setFloor("3F"); $mediaInputs-> setFloorSpace("40.15"); $mediaInputs-> setHeight("10.11"); $mediaInputs-> setIsVertical("1"); $mediaInputs-> setIsVoice("1"); $mediaInputs-> setLatitude("26.068504"); $mediaInputs-> setLength("10.11"); $mediaInputs-> setLongitude("119.292912"); $mediaInputs-> setMaterialSize("100*100*100"); $mediaInputs-> setMaterialTime("15"); $mediaInputs-> setMediaId("98N7"); $mediaInputs-> setMediaNumber("50"); $mediaInputs-> setMediaPicture("http://www.suning.com/1,jpg"); $mediaInputs-> setMediaPlayDuration("5|15|30|60"); $mediaInputs-> setOperate("0"); $mediaInputs-> setParkingSpace("110"); $mediaInputs-> setPassengerNumber("1000000"); $mediaInputs-> setPrice("150.66"); $mediaInputs-> setProhibitedContent("医药类"); $mediaInputs-> setPropertyCosts("100.98"); $mediaInputs-> setProvinceName("江苏省"); $mediaInputs-> setRemarks("这是电子屏"); $mediaInputs-> setResolution("1920X1080"); $mediaInputs-> setSalesType("1"); $mediaInputs-> setScreenPosition("1|2|3|4|5"); $mediaInputs-> setSenceId("1001"); $mediaInputs-> setShopName("紫金嘉悦"); $mediaInputs-> setShopNumber("5"); $mediaInputs-> setShopProperty("性质属性"); $mediaInputs-> setShowPosition("1"); $mediaInputs-> setStoreTypes("19"); $mediaInputs-> setUnitCount("10"); $mediaInputs-> setUnitNumber("3"); $mediaInputs-> setWidth("10.11"); $req -> setMediaInputs(array($mediaInputs)); $req -> setStoreType("19"); //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);
调用示例(.NET)
复制全部代码
using suning_api_sdk.BizRequest.CustomAdvertiseRequest; using suning_api_sdk.BizResponse.CustomAdvertiseResponse; using suning_api_sdk.Models.CustomAdvertiseModel; ChannelAddRequest request = new ChannelAddRequest(); ChannelAddMediaInputsReq mediaInputs= new ChannelAddMediaInputsReq(); mediaInputs.address="玄武大道1号"; mediaInputs.areaName="玄武区"; mediaInputs.buildingNumber="50"; mediaInputs.businessHours="12"; mediaInputs.categoryCode="AdPosition_SmallShop_Type_video2"; mediaInputs.cityName="南京市"; mediaInputs.contractNumber="SN12239991"; mediaInputs.coverNumber="10000"; mediaInputs.cpmPrice="100.01"; mediaInputs.cptMaxPlayTimes="100"; mediaInputs.cptMediaMode="1"; mediaInputs.cptPlayTimes="200"; mediaInputs.cptPrice="100.01"; mediaInputs.cptPublishDates="1,2,3,4,5"; mediaInputs.cptSalesTimes="300"; mediaInputs.detailedLocation="紫金嘉悦东大门门口"; mediaInputs.duration="day"; mediaInputs.floor="3F"; mediaInputs.floorSpace="40.15"; mediaInputs.height="10.11"; mediaInputs.isVertical="1"; mediaInputs.isVoice="1"; mediaInputs.latitude="26.068504"; mediaInputs.length="10.11"; mediaInputs.longitude="119.292912"; mediaInputs.materialSize="100*100*100"; mediaInputs.materialTime="15"; mediaInputs.mediaId="98N7"; mediaInputs.mediaNumber="50"; mediaInputs.mediaPicture="http://www.suning.com/1,jpg"; mediaInputs.mediaPlayDuration="5|15|30|60"; mediaInputs.operate="0"; mediaInputs.parkingSpace="110"; mediaInputs.passengerNumber="1000000"; mediaInputs.price="150.66"; mediaInputs.prohibitedContent="医药类"; mediaInputs.propertyCosts="100.98"; mediaInputs.provinceName="江苏省"; mediaInputs.remarks="这是电子屏"; mediaInputs.resolution="1920X1080"; mediaInputs.salesType="1"; mediaInputs.screenPosition="1|2|3|4|5"; mediaInputs.senceId="1001"; mediaInputs.shopName="紫金嘉悦"; mediaInputs.shopNumber="5"; mediaInputs.shopProperty="性质属性"; mediaInputs.showPosition="1"; mediaInputs.storeTypes="19"; mediaInputs.unitCount="10"; mediaInputs.unitNumber="3"; mediaInputs.width="10.11"; List
mediaInputsList =new ArrayList
(); mediaInputsList.add(mediaInputs); request.mediaInputs=mediaInputsList; request.storeType="19"; //开启日志调试,当测试稳定之后建议设置为 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); ChannelAddResponse response = client.Execute(request);
调用示例(PYTHON)
复制全部代码
# -*- coding: utf-8 -*- import suning.api request = suning.api.advertise.ChannelAddRequest() request. mediaInputs= [{ address:"玄武大道1号", areaName:"玄武区", buildingNumber:"50", businessHours:"12", categoryCode:"AdPosition_SmallShop_Type_video2", cityName:"南京市", contractNumber:"SN12239991", coverNumber:"10000", cpmPrice:"100.01", cptMaxPlayTimes:"100", cptMediaMode:"1", cptPlayTimes:"200", cptPrice:"100.01", cptPublishDates:"1,2,3,4,5", cptSalesTimes:"300", detailedLocation:"紫金嘉悦东大门门口", duration:"day", floor:"3F", floorSpace:"40.15", height:"10.11", isVertical:"1", isVoice:"1", latitude:"26.068504", length:"10.11", longitude:"119.292912", materialSize:"100*100*100", materialTime:"15", mediaId:"98N7", mediaNumber:"50", mediaPicture:"http://www.suning.com/1,jpg", mediaPlayDuration:"5|15|30|60", operate:"0", parkingSpace:"110", passengerNumber:"1000000", price:"150.66", prohibitedContent:"医药类", propertyCosts:"100.98", provinceName:"江苏省", remarks:"这是电子屏", resolution:"1920X1080", salesType:"1", screenPosition:"1|2|3|4|5", senceId:"1001", shopName:"紫金嘉悦", shopNumber:"5", shopProperty:"性质属性", showPosition:"1", storeTypes:"19", unitCount:"10", unitNumber:"3", width:"10.11", }]; request.storeType="19"; 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)