登录
退出
首页
开放版图
苏宁有货
商家后台
文档中心
文档中心
API文档
消息中心
平台公告
工单
我的工单
提交工单
控制台
SDK调用示例
suning.selfmarket.apply.add/
调用示例(JAVA)
复制全部代码
import com.suning.api.entity.selfmarket.ApplyAddRequest; import com.suning.api.entity.selfmarket.ApplyAddResponse; ApplyAddRequest request = new ApplyAddRequest(); request.setBarpic("http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"); request.setBrandCode("A101"); request.setCategoryCode("R6101011"); ChildItem childItem= new ChildItem(); childItem.setBarcode("11"); childItem.setBarpicX("http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"); childItem.setItemCodeX("111"); ParsX parsX= new ParsX(); parsX.setParCodeX("111"); parsX.setParValueX("红色"); List
parsXList =new ArrayList
(); parsXList.add(parsX); childItem.setParsX(parsXList); childItem.setSupplierImgAUrl("http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"); List
childItemList =new ArrayList
(); childItemList.add(childItem); request.setChildItem(childItemList); 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("模块化详情内容"); detailModule.setModuleId("123"); detailModule.setModuleName("模块名称"); detailModule.setNum("1"); detailModule.setType("cat_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.setHighlightWordone("亮点词1"); request.setHighlightWordthree("亮点词3"); request.setHighlightWordtwo("亮点词2"); request.setHighPoints("高级促销卖点"); request.setIntroduction("好品质好商品"); request.setItemCode("naikeabc"); request.setMainPicVideoCode("108625"); 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); Pars pars= new Pars(); pars.setParCode("cm_model"); pars.setParValue("1"); List
parsList =new ArrayList
(); parsList.add(pars); request.setPars(parsList); request.setProductName("大衣"); 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/181223352817344502976922_x.jpg"); supplierImgUrl.setUrlB("http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"); supplierImgUrl.setUrlC("http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"); supplierImgUrl.setUrlD("http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"); supplierImgUrl.setUrlE("http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"); List
supplierImgUrlList =new ArrayList
(); supplierImgUrlList.add(supplierImgUrl); request.setSupplierImgUrl(supplierImgUrlList); request.setVideoCode("108625"); //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 { ApplyAddResponse response = client.excute(request); System.out.println("返回json/xml格式数据 :" + response.getBody()); } catch (SuningApiException e) { e.printStackTrace(); }
调用示例(PHP)
复制全部代码
$req = new ApplyAddRequest(); $req -> setBarpic("http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"); $req -> setBrandCode("A101"); $req -> setCategoryCode("R6101011"); $childItem= new ChildItem(); $childItem-> setBarcode("11"); $childItem-> setBarpicX("http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"); $childItem-> setItemCodeX("111"); $parsX= new ParsX(); $parsX-> setParCodeX("111"); $parsX-> setParValueX("红色"); $childItem-> setParsX(array($parsX)); $childItem-> setSupplierImgAUrl("http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"); $req -> setChildItem(array($childItem)); $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("模块化详情内容"); $detailModule-> setModuleId("123"); $detailModule-> setModuleName("模块名称"); $detailModule-> setNum("1"); $detailModule-> setType("cat_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 -> setHighlightWordone("亮点词1"); $req -> setHighlightWordthree("亮点词3"); $req -> setHighlightWordtwo("亮点词2"); $req -> setHighPoints("高级促销卖点"); $req -> setIntroduction("好品质好商品"); $req -> setItemCode("naikeabc"); $req -> setMainPicVideoCode("108625"); $req -> setMobilePromotionLink("http://shop.suning.com/70088824/10108744.html"); $packingList= new PackingList(); $packingList-> setPackingListName("电脑"); $packingList-> setPackingListQty("1"); $req -> setPackingList(array($packingList)); $pars= new Pars(); $pars-> setParCode("cm_model"); $pars-> setParValue("1"); $req -> setPars(array($pars)); $req -> setProductName("大衣"); $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/181223352817344502976922_x.jpg"); $supplierImgUrl-> setUrlB("http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"); $supplierImgUrl-> setUrlC("http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"); $supplierImgUrl-> setUrlD("http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"); $supplierImgUrl-> setUrlE("http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"); $req -> setSupplierImgUrl(array($supplierImgUrl)); $req -> setVideoCode("108625"); //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; ApplyAddRequest request = new ApplyAddRequest(); request.barpic="http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"; request.brandCode="A101"; request.categoryCode="R6101011"; ApplyAddChildItemReq childItem= new ApplyAddChildItemReq(); childItem.barcode="11"; childItem.barpicX="http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"; childItem.itemCodeX="111"; ApplyAddParsXReq parsX= new ApplyAddParsXReq(); parsX.parCodeX="111"; parsX.parValueX="红色"; List
parsXList =new ArrayList
(); parsXList.add(parsX); childItem.parsX=parsXList; childItem.supplierImgAUrl="http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"; List
childItemList =new ArrayList
(); childItemList.add(childItem); request.childItem=childItemList; request.cmTitle="商品标题"; request.conventionBeginTime="2018-02-13 11:37:00"; request.conventionEndTime="2018-02-13 11:37:00"; request.conventionPoints="常规促销卖点"; ApplyAddDetailModuleReq detailModule= new ApplyAddDetailModuleReq(); detailModule.content="模块化详情内容"; detailModule.moduleId="123"; detailModule.moduleName="模块名称"; detailModule.num="1"; detailModule.type="cat_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.highlightWordone="亮点词1"; request.highlightWordthree="亮点词3"; request.highlightWordtwo="亮点词2"; request.highPoints="高级促销卖点"; request.introduction="好品质好商品"; request.itemCode="naikeabc"; request.mainPicVideoCode="108625"; request.mobilePromotionLink="http://shop.suning.com/70088824/10108744.html"; ApplyAddPackingListReq packingList= new ApplyAddPackingListReq(); packingList.packingListName="电脑"; packingList.packingListQty="1"; List
packingListList =new ArrayList
(); packingListList.add(packingList); request.packingList=packingListList; ApplyAddParsReq pars= new ApplyAddParsReq(); pars.parCode="cm_model"; pars.parValue="1"; List
parsList =new ArrayList
(); parsList.add(pars); request.pars=parsList; request.productName="大衣"; request.promotionFlag="是"; request.promotionLink="http://shop.suning.com/70088824/10108744.html"; request.promotionPoints="活动关联文案"; request.sellingPoints="商品卖点"; request.startTime="2018-02-13 11:37:00"; ApplyAddSupplierImgUrlReq supplierImgUrl= new ApplyAddSupplierImgUrlReq(); supplierImgUrl.urlA="http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"; supplierImgUrl.urlB="http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"; supplierImgUrl.urlC="http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"; supplierImgUrl.urlD="http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"; supplierImgUrl.urlE="http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"; List
supplierImgUrlList =new ArrayList
(); supplierImgUrlList.add(supplierImgUrl); request.supplierImgUrl=supplierImgUrlList; request.videoCode="108625"; //开启日志调试,当测试稳定之后建议设置为 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); ApplyAddResponse response = client.Execute(request);
调用示例(PYTHON)
复制全部代码
# -*- coding: utf-8 -*- import suning.api request = suning.api.selfmarket.ApplyAddRequest() request.barpic="http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"; request.brandCode="A101"; request.categoryCode="R6101011"; request. childItem= [{ barcode:"11", barpicX:"http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg", itemCodeX:"111", parsX: [{ parCodeX:"111", parValueX:"红色", }], supplierImgAUrl:"http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg", }]; request.cmTitle="商品标题"; request.conventionBeginTime="2018-02-13 11:37:00"; request.conventionEndTime="2018-02-13 11:37:00"; request.conventionPoints="常规促销卖点"; request. detailModule= [{ content:"模块化详情内容", moduleId:"123", moduleName:"模块名称", num:"1", type:"cat_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.highlightWordone="亮点词1"; request.highlightWordthree="亮点词3"; request.highlightWordtwo="亮点词2"; request.highPoints="高级促销卖点"; request.introduction="好品质好商品"; request.itemCode="naikeabc"; request.mainPicVideoCode="108625"; request.mobilePromotionLink="http://shop.suning.com/70088824/10108744.html"; request. packingList= [{ packingListName:"电脑", packingListQty:"1", }]; request. pars= [{ parCode:"cm_model", parValue:"1", }]; request.productName="大衣"; 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/181223352817344502976922_x.jpg", urlB:"http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg", urlC:"http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg", urlD:"http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg", urlE:"http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg", }]; request.videoCode="108625"; 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)