登录
退出
首页
开放版图
苏宁有货
商家后台
文档中心
文档中心
API文档
消息中心
平台公告
工单
我的工单
提交工单
控制台
SDK调用示例
suning.custom.book.itemcontents.modify/
调用示例(JAVA)
复制全部代码
import com.suning.api.entity.custom.ItemcontentsModifyRequest; import com.suning.api.entity.custom.ItemcontentsModifyResponse; ItemcontentsModifyRequest request = new ItemcontentsModifyRequest(); request.setProductCode("105560068"); request.setSellPoint("十万个为什么"); request.setFreightTemplateId("9787511002884"); request.setItemCode("111"); request.setAfterSaleServiceDec("七天包退换"); request.setSaleSet("0"); request.setSaleDate("2014-01-06"); request.setAssortCode("11111111"); request.setCmTitle("1"); request.setSupplierImg1Url("1"); request.setSupplierImg2Url("1"); request.setSupplierImg3Url("1"); request.setSupplierImg4Url("1"); request.setSupplierImg5Url("1"); //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 -> setProductCode("105560068"); $req -> setSellPoint("十万个为什么"); $req -> setFreightTemplateId("9787511002884"); $req -> setItemCode("111"); $req -> setAfterSaleServiceDec("七天包退换"); $req -> setSaleSet("0"); $req -> setSaleDate("2014-01-06"); $req -> setAssortCode("11111111"); $req -> setCmTitle("1"); $req -> setSupplierImg1Url("1"); $req -> setSupplierImg2Url("1"); $req -> setSupplierImg3Url("1"); $req -> setSupplierImg4Url("1"); $req -> setSupplierImg5Url("1"); //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.CustomCustomRequest; using suning_api_sdk.BizResponse.CustomCustomResponse; using suning_api_sdk.Models.CustomCustomModel; ItemcontentsModifyRequest request = new ItemcontentsModifyRequest(); request.productCode="105560068"; request.sellPoint="十万个为什么"; request.freightTemplateId="9787511002884"; request.itemCode="111"; request.afterSaleServiceDec="七天包退换"; request.saleSet="0"; request.saleDate="2014-01-06"; request.assortCode="11111111"; request.cmTitle="1"; request.supplierImg1Url="1"; request.supplierImg2Url="1"; request.supplierImg3Url="1"; request.supplierImg4Url="1"; request.supplierImg5Url="1"; //开启日志调试,当测试稳定之后建议设置为 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.custom.ItemcontentsModifyRequest() request.productCode="105560068" request.sellPoint="十万个为什么" request.freightTemplateId="9787511002884" request.itemCode="111" request.afterSaleServiceDec="七天包退换" request.saleSet="0" request.saleDate="2014-01-06" request.assortCode="11111111" request.cmTitle="1" request.supplierImg1Url="1" request.supplierImg2Url="1" request.supplierImg3Url="1" request.supplierImg4Url="1" request.supplierImg5Url="1" 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)