登录
退出
首页
开放版图
苏宁有货
商家后台
文档中心
文档中心
API文档
消息中心
平台公告
工单
我的工单
提交工单
控制台
SDK调用示例
suning.saleoff.cmmdtyinfo.modify/
调用示例(JAVA)
复制全部代码
import com.suning.api.entity.saleoff.CmmdtyinfoModifyRequest; import com.suning.api.entity.saleoff.CmmdtyinfoModifyResponse; CmmdtyinfoModifyRequest request = new CmmdtyinfoModifyRequest(); request.setActivityPic("http://1.jpg"); request.setAfterSaleServiceDec("324234"); ChildItem childItem= new ChildItem(); childItem.setItemCodeX("1"); childItem.setProductCodeX("100000001"); childItem.setSupplierImgAUrlX("http://1.jpg"); List
childItemList =new ArrayList
(); childItemList.add(childItem); request.setChildItem(childItemList); request.setCmTitle("4324"); DetailModule detailModule= new DetailModule(); detailModule.setContent("34"); detailModule.setModuleId("R2701001_1"); detailModule.setModuleName("优惠信息"); detailModule.setNum("1"); detailModule.setType("cat_mod"); List
detailModuleList =new ArrayList
(); detailModuleList.add(detailModule); request.setDetailModule(detailModuleList); request.setIntroduction("23123"); request.setItemCode("324234"); request.setLtpic("http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"); request.setMainPicVideoCode("108625"); PackingList packingList= new PackingList(); packingList.setPackingListName("电脑"); packingList.setPackingListQty("1"); List
packingListList =new ArrayList
(); packingListList.add(packingList); request.setPackingList(packingListList); request.setProductCode("4324"); request.setSellPoint("34234"); request.setSupplierImgAUrl("http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"); request.setSupplierImgBUrl("http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"); request.setSupplierImgCUrl("http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"); request.setSupplierImgDUrl("http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"); request.setSupplierImgEUrl(" http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"); 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 { CmmdtyinfoModifyResponse response = client.excute(request); System.out.println("返回json/xml格式数据 :" + response.getBody()); } catch (SuningApiException e) { e.printStackTrace(); }
调用示例(PHP)
复制全部代码
$req = new CmmdtyinfoModifyRequest(); $req -> setActivityPic("http://1.jpg"); $req -> setAfterSaleServiceDec("324234"); $childItem= new ChildItem(); $childItem-> setItemCodeX("1"); $childItem-> setProductCodeX("100000001"); $childItem-> setSupplierImgAUrlX("http://1.jpg"); $req -> setChildItem(array($childItem)); $req -> setCmTitle("4324"); $detailModule= new DetailModule(); $detailModule-> setContent("34"); $detailModule-> setModuleId("R2701001_1"); $detailModule-> setModuleName("优惠信息"); $detailModule-> setNum("1"); $detailModule-> setType("cat_mod"); $req -> setDetailModule(array($detailModule)); $req -> setIntroduction("23123"); $req -> setItemCode("324234"); $req -> setLtpic("http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"); $req -> setMainPicVideoCode("108625"); $packingList= new PackingList(); $packingList-> setPackingListName("电脑"); $packingList-> setPackingListQty("1"); $req -> setPackingList(array($packingList)); $req -> setProductCode("4324"); $req -> setSellPoint("34234"); $req -> setSupplierImgAUrl("http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"); $req -> setSupplierImgBUrl("http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"); $req -> setSupplierImgCUrl("http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"); $req -> setSupplierImgDUrl("http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"); $req -> setSupplierImgEUrl(" http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"); $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.CustomSaleoffRequest; using suning_api_sdk.BizResponse.CustomSaleoffResponse; using suning_api_sdk.Models.CustomSaleoffModel; CmmdtyinfoModifyRequest request = new CmmdtyinfoModifyRequest(); request.activityPic="http://1.jpg"; request.afterSaleServiceDec="324234"; CmmdtyinfoModifyChildItemReq childItem= new CmmdtyinfoModifyChildItemReq(); childItem.itemCodeX="1"; childItem.productCodeX="100000001"; childItem.supplierImgAUrlX="http://1.jpg"; List
childItemList =new ArrayList
(); childItemList.add(childItem); request.childItem=childItemList; request.cmTitle="4324"; CmmdtyinfoModifyDetailModuleReq detailModule= new CmmdtyinfoModifyDetailModuleReq(); detailModule.content="34"; detailModule.moduleId="R2701001_1"; detailModule.moduleName="优惠信息"; detailModule.num="1"; detailModule.type="cat_mod"; List
detailModuleList =new ArrayList
(); detailModuleList.add(detailModule); request.detailModule=detailModuleList; request.introduction="23123"; request.itemCode="324234"; request.ltpic="http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"; request.mainPicVideoCode="108625"; CmmdtyinfoModifyPackingListReq packingList= new CmmdtyinfoModifyPackingListReq(); packingList.packingListName="电脑"; packingList.packingListQty="1"; List
packingListList =new ArrayList
(); packingListList.add(packingList); request.packingList=packingListList; request.productCode="4324"; request.sellPoint="34234"; request.supplierImgAUrl="http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"; request.supplierImgBUrl="http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"; request.supplierImgCUrl="http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"; request.supplierImgDUrl="http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"; request.supplierImgEUrl=" http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"; 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); CmmdtyinfoModifyResponse response = client.Execute(request);
调用示例(PYTHON)
复制全部代码
# -*- coding: utf-8 -*- import suning.api request = suning.api.saleoff.CmmdtyinfoModifyRequest() request.activityPic="http://1.jpg"; request.afterSaleServiceDec="324234"; request. childItem= [{ itemCodeX:"1", productCodeX:"100000001", supplierImgAUrlX:"http://1.jpg", }]; request.cmTitle="4324"; request. detailModule= [{ content:"34", moduleId:"R2701001_1", moduleName:"优惠信息", num:"1", type:"cat_mod", }]; request.introduction="23123"; request.itemCode="324234"; request.ltpic="http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"; request.mainPicVideoCode="108625"; request. packingList= [{ packingListName:"电脑", packingListQty:"1", }]; request.productCode="4324"; request.sellPoint="34234"; request.supplierImgAUrl="http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"; request.supplierImgBUrl="http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"; request.supplierImgCUrl="http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"; request.supplierImgDUrl="http://10.19.95.100/uimg/sop/commodity/181223352817344502976922_x.jpg"; request.supplierImgEUrl=" 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)