登录
退出
首页
开放版图
苏宁有货
商家后台
文档中心
文档中心
API文档
消息中心
平台公告
工单
我的工单
提交工单
控制台
SDK调用示例
suning.integrate.itemcontents.modify/
调用示例(JAVA)
复制全部代码
import com.suning.api.entity.integrate.itemContentsModifyRequest; import com.suning.api.entity.integrate.itemContentsModifyResponse; itemContentsModifyRequest request = new itemContentsModifyRequest(); request.setAfterSaleServiceDec("一年内包退换"); request.setAssortCode("11111111"); ChildItem childItem= new ChildItem(); childItem.setItemCode("11"); childItem.setProductCode("11000000002"); childItem.setSupplierImg1Url("http://1.jpg..."); List
childItemList =new ArrayList
(); childItemList.add(childItem); request.setChildItem(childItemList); request.setCmTitle("商品标题"); DetailModule detailModule= new DetailModule(); detailModule.setContent("5aW95ZWG5ZOB"); detailModule.setModuleId("1"); detailModule.setModuleName("售后服务"); detailModule.setNum("1"); detailModule.setType("usr_mod"); List
detailModuleList =new ArrayList
(); detailModuleList.add(detailModule); request.setDetailModule(detailModuleList); request.setIntroduction("5aW95ZWG5ZOB"); request.setItemCode("naikeabc"); Mobile mobile= new Mobile(); ListInfo listInfo= new ListInfo(); listInfo.setNum("1"); listInfo.setPic("http://1.jpg"); listInfo.setText("1"); List
listInfoList =new ArrayList
(); listInfoList.add(listInfo); mobile.setListInfo(listInfoList); mobile.setSummary("1"); request.setMobile(mobile); MobileNew mobileNew= new MobileNew(); Module module= new Module(); module.setCouponId("1"); module.setImgUrl("http://1.jpg"); module.setModuleName("售后服务"); module.setModuleStatus("0"); module.setTuijianId("1"); List
moduleList =new ArrayList
(); moduleList.add(module); mobileNew.setModule(moduleList); request.setMobileNew(mobileNew); PackingList packingList= new PackingList(); packingList.setPackingListName("装箱清单名称"); packingList.setPackingListQty("1"); List
packingListList =new ArrayList
(); packingListList.add(packingList); request.setPackingList(packingListList); request.setPeopleNum("5"); request.setProductCode("1000000001"); request.setPurchaseMax("10"); request.setPurchaseMin("5"); request.setSaleDate("2013-10-1"); request.setSaleSet("0"); request.setSellPoint("好东西"); request.setSourceCountry("11111111"); request.setSupplierImg10Url("http://1.jpg..."); request.setSupplierImg1Url("http://1.jpg..."); request.setSupplierImg2Url("http://1.jpg..."); request.setSupplierImg3Url("http://1.jpg..."); request.setSupplierImg4Url("http://1.jpg..."); request.setSupplierImg5Url("http://1.jpg..."); request.setSupplierImg6Url("http://1.jpg..."); request.setSupplierImg7Url("http://1.jpg..."); request.setSupplierImg8Url("http://1.jpg..."); request.setSupplierImg9Url("http://1.jpg..."); //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 { itemContentsModifyResponse response = client.excute(request); System.out.println("返回json/xml格式数据 :" + response.getBody()); } catch (SuningApiException e) { e.printStackTrace(); }
调用示例(PHP)
复制全部代码
$req = new itemContentsModifyRequest(); $req -> setAfterSaleServiceDec("一年内包退换"); $req -> setAssortCode("11111111"); $childItem= new ChildItem(); $childItem-> setItemCode("11"); $childItem-> setProductCode("11000000002"); $childItem-> setSupplierImg1Url("http://1.jpg..."); $req -> setChildItem(array($childItem)); $req -> setCmTitle("商品标题"); $detailModule= new DetailModule(); $detailModule-> setContent("5aW95ZWG5ZOB"); $detailModule-> setModuleId("1"); $detailModule-> setModuleName("售后服务"); $detailModule-> setNum("1"); $detailModule-> setType("usr_mod"); $req -> setDetailModule(array($detailModule)); $req -> setIntroduction("5aW95ZWG5ZOB"); $req -> setItemCode("naikeabc"); $mobile= new Mobile(); $listInfo= new ListInfo(); $listInfo-> setNum("1"); $listInfo-> setPic("http://1.jpg"); $listInfo-> setText("1"); $mobile-> setListInfo(array($listInfo)); $mobile-> setSummary("1"); $req -> setMobile($mobile); $mobileNew= new MobileNew(); $module= new Module(); $module-> setCouponId("1"); $module-> setImgUrl("http://1.jpg"); $module-> setModuleName("售后服务"); $module-> setModuleStatus("0"); $module-> setTuijianId("1"); $mobileNew-> setModule(array($module)); $req -> setMobileNew($mobileNew); $packingList= new PackingList(); $packingList-> setPackingListName("装箱清单名称"); $packingList-> setPackingListQty("1"); $req -> setPackingList(array($packingList)); $req -> setPeopleNum("5"); $req -> setProductCode("1000000001"); $req -> setPurchaseMax("10"); $req -> setPurchaseMin("5"); $req -> setSaleDate("2013-10-1"); $req -> setSaleSet("0"); $req -> setSellPoint("好东西"); $req -> setSourceCountry("11111111"); $req -> setSupplierImg10Url("http://1.jpg..."); $req -> setSupplierImg1Url("http://1.jpg..."); $req -> setSupplierImg2Url("http://1.jpg..."); $req -> setSupplierImg3Url("http://1.jpg..."); $req -> setSupplierImg4Url("http://1.jpg..."); $req -> setSupplierImg5Url("http://1.jpg..."); $req -> setSupplierImg6Url("http://1.jpg..."); $req -> setSupplierImg7Url("http://1.jpg..."); $req -> setSupplierImg8Url("http://1.jpg..."); $req -> setSupplierImg9Url("http://1.jpg..."); //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.CustomIntegrateRequest; using suning_api_sdk.BizResponse.CustomIntegrateResponse; using suning_api_sdk.Models.CustomIntegrateModel; itemContentsModifyRequest request = new itemContentsModifyRequest(); request.afterSaleServiceDec="一年内包退换"; request.assortCode="11111111"; itemContentsModifyChildItemReq childItem= new itemContentsModifyChildItemReq(); childItem.itemCode="11"; childItem.productCode="11000000002"; childItem.supplierImg1Url="http://1.jpg..."; List
childItemList =new ArrayList
(); childItemList.add(childItem); request.childItem=childItemList; request.cmTitle="商品标题"; itemContentsModifyDetailModuleReq detailModule= new itemContentsModifyDetailModuleReq(); detailModule.content="5aW95ZWG5ZOB"; detailModule.moduleId="1"; detailModule.moduleName="售后服务"; detailModule.num="1"; detailModule.type="usr_mod"; List
detailModuleList =new ArrayList
(); detailModuleList.add(detailModule); request.detailModule=detailModuleList; request.introduction="5aW95ZWG5ZOB"; request.itemCode="naikeabc"; itemContentsModifyMobileReq mobile= new itemContentsModifyMobileReq(); itemContentsModifyListInfoReq listInfo= new itemContentsModifyListInfoReq(); listInfo.num="1"; listInfo.pic="http://1.jpg"; listInfo.text="1"; List
listInfoList =new ArrayList
(); listInfoList.add(listInfo); mobile.listInfo=listInfoList; mobile.summary="1"; request.mobile=mobile; itemContentsModifyMobileNewReq mobileNew= new itemContentsModifyMobileNewReq(); itemContentsModifyModuleReq module= new itemContentsModifyModuleReq(); module.couponId="1"; module.imgUrl="http://1.jpg"; module.moduleName="售后服务"; module.moduleStatus="0"; module.tuijianId="1"; List
moduleList =new ArrayList
(); moduleList.add(module); mobileNew.module=moduleList; request.mobileNew=mobileNew; itemContentsModifyPackingListReq packingList= new itemContentsModifyPackingListReq(); packingList.packingListName="装箱清单名称"; packingList.packingListQty="1"; List
packingListList =new ArrayList
(); packingListList.add(packingList); request.packingList=packingListList; request.peopleNum="5"; request.productCode="1000000001"; request.purchaseMax="10"; request.purchaseMin="5"; request.saleDate="2013-10-1"; request.saleSet="0"; request.sellPoint="好东西"; request.sourceCountry="11111111"; request.supplierImg10Url="http://1.jpg..."; request.supplierImg1Url="http://1.jpg..."; request.supplierImg2Url="http://1.jpg..."; request.supplierImg3Url="http://1.jpg..."; request.supplierImg4Url="http://1.jpg..."; request.supplierImg5Url="http://1.jpg..."; request.supplierImg6Url="http://1.jpg..."; request.supplierImg7Url="http://1.jpg..."; request.supplierImg8Url="http://1.jpg..."; request.supplierImg9Url="http://1.jpg..."; //开启日志调试,当测试稳定之后建议设置为 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); itemContentsModifyResponse response = client.Execute(request);
调用示例(PYTHON)
复制全部代码
# -*- coding: utf-8 -*- import suning.api request = suning.api.integrate.itemContentsModifyRequest() request.afterSaleServiceDec="一年内包退换"; request.assortCode="11111111"; request. childItem= [{ itemCode:"11", productCode:"11000000002", supplierImg1Url:"http://1.jpg...", }]; request.cmTitle="商品标题"; request. detailModule= [{ content:"5aW95ZWG5ZOB", moduleId:"1", moduleName:"售后服务", num:"1", type:"usr_mod", }]; request.introduction="5aW95ZWG5ZOB"; request.itemCode="naikeabc"; request. mobile= { listInfo: [{ num:"1", pic:"http://1.jpg", text:"1", }], summary:"1", }; request. mobileNew= { module: [{ couponId:"1", imgUrl:"http://1.jpg", moduleName:"售后服务", moduleStatus:"0", tuijianId:"1", }], }; request. packingList= [{ packingListName:"装箱清单名称", packingListQty:"1", }]; request.peopleNum="5"; request.productCode="1000000001"; request.purchaseMax="10"; request.purchaseMin="5"; request.saleDate="2013-10-1"; request.saleSet="0"; request.sellPoint="好东西"; request.sourceCountry="11111111"; request.supplierImg10Url="http://1.jpg..."; request.supplierImg1Url="http://1.jpg..."; request.supplierImg2Url="http://1.jpg..."; request.supplierImg3Url="http://1.jpg..."; request.supplierImg4Url="http://1.jpg..."; request.supplierImg5Url="http://1.jpg..."; request.supplierImg6Url="http://1.jpg..."; request.supplierImg7Url="http://1.jpg..."; request.supplierImg8Url="http://1.jpg..."; request.supplierImg9Url="http://1.jpg..."; 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)