登录
退出
首页
开放版图
苏宁有货
商家后台
文档中心
文档中心
API文档
消息中心
平台公告
工单
我的工单
提交工单
控制台
SDK调用示例
suning.selfmarket.publish.modify/
调用示例(JAVA)
复制全部代码
import com.suning.api.entity.selfmarket.PublishModifyRequest; import com.suning.api.entity.selfmarket.PublishModifyResponse; PublishModifyRequest request = new PublishModifyRequest(); request.setCmTitle("商品标题"); request.setConventionBeginTime("2018-02-13 11:37:00"); request.setConventionEndTime("2018-02-13 11:37:00"); request.setConventionPoints("常规促销卖点"); DetailModule detailModule= new DetailModule(); detailModule.setContent("5qih5Z2X5YyW6K+m5oOF5YaF5a65"); detailModule.setModuleId("R2701001_1"); detailModule.setModuleName("优惠信息"); detailModule.setNum("1"); detailModule.setType("usr_mod"); List
detailModuleList =new ArrayList
(); detailModuleList.add(detailModule); request.setDetailModule(detailModuleList); request.setEndTime("2018-02-13 11:37:00"); request.setHighBeginTime("2018-02-13 11:37:00"); request.setHighEndTime("2018-02-13 11:37:00"); request.setHighPoints("高级促销卖点"); request.setIntroduction("电脑详情"); request.setItemCode("naikeabc"); request.setMobilePromotionLink("http://shop.suning.com/70088824/10108744.html"); PackingList packingList= new PackingList(); packingList.setPackingListName("电脑"); packingList.setPackingListQty("1"); List
packingListList =new ArrayList
(); packingListList.add(packingList); request.setPackingList(packingListList); request.setProductCode("750047486"); request.setPromotionFlag("是"); request.setPromotionLink("http://shop.suning.com/70088824/10108744.html"); request.setPromotionPoints("活动关联文案"); request.setSellingPoints("商品卖点"); request.setStartTime("2018-02-13 11:37:00"); SupplierImgUrl supplierImgUrl= new SupplierImgUrl(); supplierImgUrl.setUrlA("http://10.19.95.100/uimg/sop/commodity/623952902322391517989000_x.jpg"); supplierImgUrl.setUrlB("http://10.19.95.100/uimg/sop/commodity/623952902322391517989000_x.jpg"); supplierImgUrl.setUrlC("http://10.19.95.100/uimg/sop/commodity/623952902322391517989000_x.jpg"); supplierImgUrl.setUrlD("http://10.19.95.100/uimg/sop/commodity/623952902322391517989000_x.jpg"); supplierImgUrl.setUrlE("http://10.19.95.100/uimg/sop/commodity/623952902322391517989000_x.jpg"); List
supplierImgUrlList =new ArrayList
(); supplierImgUrlList.add(supplierImgUrl); request.setSupplierImgUrl(supplierImgUrlList); request.setVideoCode("108625"); request.setMainPicVideoCode("108991"); request.setHighlightWordone("亮点词1"); request.setHighlightWordtwo("亮点词2"); request.setHighlightWordthree("亮点词3"); //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 { PublishModifyResponse response = client.excute(request); System.out.println("返回json/xml格式数据 :" + response.getBody()); } catch (SuningApiException e) { e.printStackTrace(); }
调用示例(PHP)
复制全部代码
$req = new PublishModifyRequest(); $req -> setCmTitle("商品标题"); $req -> setConventionBeginTime("2018-02-13 11:37:00"); $req -> setConventionEndTime("2018-02-13 11:37:00"); $req -> setConventionPoints("常规促销卖点"); $detailModule= new DetailModule(); $detailModule-> setContent("5qih5Z2X5YyW6K+m5oOF5YaF5a65"); $detailModule-> setModuleId("R2701001_1"); $detailModule-> setModuleName("优惠信息"); $detailModule-> setNum("1"); $detailModule-> setType("usr_mod"); $req -> setDetailModule(array($detailModule)); $req -> setEndTime("2018-02-13 11:37:00"); $req -> setHighBeginTime("2018-02-13 11:37:00"); $req -> setHighEndTime("2018-02-13 11:37:00"); $req -> setHighPoints("高级促销卖点"); $req -> setIntroduction("电脑详情"); $req -> setItemCode("naikeabc"); $req -> setMobilePromotionLink("http://shop.suning.com/70088824/10108744.html"); $packingList= new PackingList(); $packingList-> setPackingListName("电脑"); $packingList-> setPackingListQty("1"); $req -> setPackingList(array($packingList)); $req -> setProductCode("750047486"); $req -> setPromotionFlag("是"); $req -> setPromotionLink("http://shop.suning.com/70088824/10108744.html"); $req -> setPromotionPoints("活动关联文案"); $req -> setSellingPoints("商品卖点"); $req -> setStartTime("2018-02-13 11:37:00"); $supplierImgUrl= new SupplierImgUrl(); $supplierImgUrl-> setUrlA("http://10.19.95.100/uimg/sop/commodity/623952902322391517989000_x.jpg"); $supplierImgUrl-> setUrlB("http://10.19.95.100/uimg/sop/commodity/623952902322391517989000_x.jpg"); $supplierImgUrl-> setUrlC("http://10.19.95.100/uimg/sop/commodity/623952902322391517989000_x.jpg"); $supplierImgUrl-> setUrlD("http://10.19.95.100/uimg/sop/commodity/623952902322391517989000_x.jpg"); $supplierImgUrl-> setUrlE("http://10.19.95.100/uimg/sop/commodity/623952902322391517989000_x.jpg"); $req -> setSupplierImgUrl(array($supplierImgUrl)); $req -> setVideoCode("108625"); $req -> setMainPicVideoCode("108991"); $req -> setHighlightWordone("亮点词1"); $req -> setHighlightWordtwo("亮点词2"); $req -> setHighlightWordthree("亮点词3"); //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.CustomSelfmarketRequest; using suning_api_sdk.BizResponse.CustomSelfmarketResponse; using suning_api_sdk.Models.CustomSelfmarketModel; PublishModifyRequest request = new PublishModifyRequest(); request.cmTitle="商品标题"; request.conventionBeginTime="2018-02-13 11:37:00"; request.conventionEndTime="2018-02-13 11:37:00"; request.conventionPoints="常规促销卖点"; PublishModifyDetailModuleReq detailModule= new PublishModifyDetailModuleReq(); detailModule.content="5qih5Z2X5YyW6K+m5oOF5YaF5a65"; detailModule.moduleId="R2701001_1"; detailModule.moduleName="优惠信息"; detailModule.num="1"; detailModule.type="usr_mod"; List
detailModuleList =new ArrayList
(); detailModuleList.add(detailModule); request.detailModule=detailModuleList; request.endTime="2018-02-13 11:37:00"; request.highBeginTime="2018-02-13 11:37:00"; request.highEndTime="2018-02-13 11:37:00"; request.highPoints="高级促销卖点"; request.introduction="电脑详情"; request.itemCode="naikeabc"; request.mobilePromotionLink="http://shop.suning.com/70088824/10108744.html"; PublishModifyPackingListReq packingList= new PublishModifyPackingListReq(); packingList.packingListName="电脑"; packingList.packingListQty="1"; List
packingListList =new ArrayList
(); packingListList.add(packingList); request.packingList=packingListList; request.productCode="750047486"; request.promotionFlag="是"; request.promotionLink="http://shop.suning.com/70088824/10108744.html"; request.promotionPoints="活动关联文案"; request.sellingPoints="商品卖点"; request.startTime="2018-02-13 11:37:00"; PublishModifySupplierImgUrlReq supplierImgUrl= new PublishModifySupplierImgUrlReq(); supplierImgUrl.urlA="http://10.19.95.100/uimg/sop/commodity/623952902322391517989000_x.jpg"; supplierImgUrl.urlB="http://10.19.95.100/uimg/sop/commodity/623952902322391517989000_x.jpg"; supplierImgUrl.urlC="http://10.19.95.100/uimg/sop/commodity/623952902322391517989000_x.jpg"; supplierImgUrl.urlD="http://10.19.95.100/uimg/sop/commodity/623952902322391517989000_x.jpg"; supplierImgUrl.urlE="http://10.19.95.100/uimg/sop/commodity/623952902322391517989000_x.jpg"; List
supplierImgUrlList =new ArrayList
(); supplierImgUrlList.add(supplierImgUrl); request.supplierImgUrl=supplierImgUrlList; request.videoCode="108625"; request.mainPicVideoCode="108991"; request.highlightWordone="亮点词1"; request.highlightWordtwo="亮点词2"; request.highlightWordthree="亮点词3"; //开启日志调试,当测试稳定之后建议设置为 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); PublishModifyResponse response = client.Execute(request);
调用示例(PYTHON)
复制全部代码
# -*- coding: utf-8 -*- import suning.api request = suning.api.selfmarket.PublishModifyRequest() request.cmTitle="商品标题"; request.conventionBeginTime="2018-02-13 11:37:00"; request.conventionEndTime="2018-02-13 11:37:00"; request.conventionPoints="常规促销卖点"; request. detailModule= [{ content:"5qih5Z2X5YyW6K+m5oOF5YaF5a65", moduleId:"R2701001_1", moduleName:"优惠信息", num:"1", type:"usr_mod", }]; request.endTime="2018-02-13 11:37:00"; request.highBeginTime="2018-02-13 11:37:00"; request.highEndTime="2018-02-13 11:37:00"; request.highPoints="高级促销卖点"; request.introduction="电脑详情"; request.itemCode="naikeabc"; request.mobilePromotionLink="http://shop.suning.com/70088824/10108744.html"; request. packingList= [{ packingListName:"电脑", packingListQty:"1", }]; request.productCode="750047486"; request.promotionFlag="是"; request.promotionLink="http://shop.suning.com/70088824/10108744.html"; request.promotionPoints="活动关联文案"; request.sellingPoints="商品卖点"; request.startTime="2018-02-13 11:37:00"; request. supplierImgUrl= [{ urlA:"http://10.19.95.100/uimg/sop/commodity/623952902322391517989000_x.jpg", urlB:"http://10.19.95.100/uimg/sop/commodity/623952902322391517989000_x.jpg", urlC:"http://10.19.95.100/uimg/sop/commodity/623952902322391517989000_x.jpg", urlD:"http://10.19.95.100/uimg/sop/commodity/623952902322391517989000_x.jpg", urlE:"http://10.19.95.100/uimg/sop/commodity/623952902322391517989000_x.jpg", }]; request.videoCode="108625"; request.mainPicVideoCode="108991"; request.highlightWordone="亮点词1"; request.highlightWordtwo="亮点词2"; request.highlightWordthree="亮点词3"; 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)