登录
退出
首页
开放版图
苏宁有货
商家后台
文档中心
文档中心
API文档
消息中心
平台公告
工单
我的工单
提交工单
控制台
SDK调用示例
suning.selfmarket.monthproduce.add/
调用示例(JAVA)
复制全部代码
import com.suning.api.entity.selfmarket.MonthproduceAddRequest; import com.suning.api.entity.selfmarket.MonthproduceAddResponse; MonthproduceAddRequest request = new MonthproduceAddRequest(); MonthProduce monthProduce= new MonthProduce(); monthProduce.setCommodityCode("1111620000000"); monthProduce.setCommodityName("R35G/HFJ+3成品"); monthProduce.setFactoryName("天津、南昌、宁波"); monthProduce.setOfflineDate("2017-04-08"); monthProduce.setOnlineDate("2017-04-08"); monthProduce.setPlanDatetime("2017-04-08 20:00:00"); monthProduce.setProduceCount("500"); monthProduce.setProduceOrder("41000943438"); List
monthProduceList =new ArrayList
(); monthProduceList.add(monthProduce); request.setMonthProduce(monthProduceList); //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 { MonthproduceAddResponse response = client.excute(request); System.out.println("返回json/xml格式数据 :" + response.getBody()); } catch (SuningApiException e) { e.printStackTrace(); }
调用示例(PHP)
复制全部代码
$req = new MonthproduceAddRequest(); $monthProduce= new MonthProduce(); $monthProduce-> setCommodityCode("1111620000000"); $monthProduce-> setCommodityName("R35G/HFJ+3成品"); $monthProduce-> setFactoryName("天津、南昌、宁波"); $monthProduce-> setOfflineDate("2017-04-08"); $monthProduce-> setOnlineDate("2017-04-08"); $monthProduce-> setPlanDatetime("2017-04-08 20:00:00"); $monthProduce-> setProduceCount("500"); $monthProduce-> setProduceOrder("41000943438"); $req -> setMonthProduce(array($monthProduce)); //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; MonthproduceAddRequest request = new MonthproduceAddRequest(); MonthproduceAddMonthProduceReq monthProduce= new MonthproduceAddMonthProduceReq(); monthProduce.commodityCode="1111620000000"; monthProduce.commodityName="R35G/HFJ+3成品"; monthProduce.factoryName="天津、南昌、宁波"; monthProduce.offlineDate="2017-04-08"; monthProduce.onlineDate="2017-04-08"; monthProduce.planDatetime="2017-04-08 20:00:00"; monthProduce.produceCount="500"; monthProduce.produceOrder="41000943438"; List
monthProduceList =new ArrayList
(); monthProduceList.add(monthProduce); request.monthProduce=monthProduceList; //开启日志调试,当测试稳定之后建议设置为 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); MonthproduceAddResponse response = client.Execute(request);
调用示例(PYTHON)
复制全部代码
# -*- coding: utf-8 -*- import suning.api request = suning.api.selfmarket.MonthproduceAddRequest() request. monthProduce= [{ commodityCode:"1111620000000", commodityName:"R35G/HFJ+3成品", factoryName:"天津、南昌、宁波", offlineDate:"2017-04-08", onlineDate:"2017-04-08", planDatetime:"2017-04-08 20:00:00", produceCount:"500", produceOrder:"41000943438", }]; 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)