登录
退出
首页
开放版图
苏宁有货
商家后台
文档中心
文档中心
API文档
消息中心
平台公告
工单
我的工单
提交工单
控制台
SDK调用示例
suning.asmp.statement.get/
调用示例(JAVA)
复制全部代码
import com.suning.api.entity.asmp.StatementGetRequest; import com.suning.api.entity.asmp.StatementGetResponse; StatementGetRequest request = new StatementGetRequest(); Detail detail= new Detail(); detail.setDetailGuid("1111"); detail.setJctype("A"); detail.setNoteItem("无"); detail.setServiceOrder("7312952676"); detail.setZawf("0"); detail.setZblpf("0"); detail.setZbtje("10"); detail.setZbtyy("A0001"); detail.setZbtyyDesc("空调旺季补贴"); detail.setZcjorder("A700020160310583354"); detail.setZcjtzkpje("125"); detail.setZcjyjje("100"); detail.setZjlje("20"); detail.setZjlyy("C0001"); detail.setZjlyyDesc("安装技术好"); detail.setZkfje("5"); detail.setZkfyy("B0001"); detail.setZkfyyDesc("顾客投诉"); detail.setZno("1111"); detail.setZpjf("0"); detail.setZqtf("0"); List
detailList =new ArrayList
(); detailList.add(detail); request.setDetail(detailList); request.setFactoryBp("10"); request.setGuid("u00000000001"); request.setNoteHeader("300"); request.setZawbs("1"); request.setZcjsqdm("123456789"); request.setZkpje("123456"); //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 { StatementGetResponse response = client.excute(request); System.out.println("返回json/xml格式数据 :" + response.getBody()); } catch (SuningApiException e) { e.printStackTrace(); }
调用示例(PHP)
复制全部代码
$req = new StatementGetRequest(); $detail= new Detail(); $detail-> setDetailGuid("1111"); $detail-> setJctype("A"); $detail-> setNoteItem("无"); $detail-> setServiceOrder("7312952676"); $detail-> setZawf("0"); $detail-> setZblpf("0"); $detail-> setZbtje("10"); $detail-> setZbtyy("A0001"); $detail-> setZbtyyDesc("空调旺季补贴"); $detail-> setZcjorder("A700020160310583354"); $detail-> setZcjtzkpje("125"); $detail-> setZcjyjje("100"); $detail-> setZjlje("20"); $detail-> setZjlyy("C0001"); $detail-> setZjlyyDesc("安装技术好"); $detail-> setZkfje("5"); $detail-> setZkfyy("B0001"); $detail-> setZkfyyDesc("顾客投诉"); $detail-> setZno("1111"); $detail-> setZpjf("0"); $detail-> setZqtf("0"); $req -> setDetail(array($detail)); $req -> setFactoryBp("10"); $req -> setGuid("u00000000001"); $req -> setNoteHeader("300"); $req -> setZawbs("1"); $req -> setZcjsqdm("123456789"); $req -> setZkpje("123456"); //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.CustomAsmpRequest; using suning_api_sdk.BizResponse.CustomAsmpResponse; using suning_api_sdk.Models.CustomAsmpModel; StatementGetRequest request = new StatementGetRequest(); StatementGetDetailReq detail= new StatementGetDetailReq(); detail.detailGuid="1111"; detail.jctype="A"; detail.noteItem="无"; detail.serviceOrder="7312952676"; detail.zawf="0"; detail.zblpf="0"; detail.zbtje="10"; detail.zbtyy="A0001"; detail.zbtyyDesc="空调旺季补贴"; detail.zcjorder="A700020160310583354"; detail.zcjtzkpje="125"; detail.zcjyjje="100"; detail.zjlje="20"; detail.zjlyy="C0001"; detail.zjlyyDesc="安装技术好"; detail.zkfje="5"; detail.zkfyy="B0001"; detail.zkfyyDesc="顾客投诉"; detail.zno="1111"; detail.zpjf="0"; detail.zqtf="0"; List
detailList =new ArrayList
(); detailList.add(detail); request.detail=detailList; request.factoryBp="10"; request.guid="u00000000001"; request.noteHeader="300"; request.zawbs="1"; request.zcjsqdm="123456789"; request.zkpje="123456"; //开启日志调试,当测试稳定之后建议设置为 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); StatementGetResponse response = client.Execute(request);
调用示例(PYTHON)
复制全部代码
# -*- coding: utf-8 -*- import suning.api request = suning.api.asmp.StatementGetRequest() request. detail= [{ detailGuid:"1111", jctype:"A", noteItem:"无", serviceOrder:"7312952676", zawf:"0", zblpf:"0", zbtje:"10", zbtyy:"A0001", zbtyyDesc:"空调旺季补贴", zcjorder:"A700020160310583354", zcjtzkpje:"125", zcjyjje:"100", zjlje:"20", zjlyy:"C0001", zjlyyDesc:"安装技术好", zkfje:"5", zkfyy:"B0001", zkfyyDesc:"顾客投诉", zno:"1111", zpjf:"0", zqtf:"0", }]; request.factoryBp="10"; request.guid="u00000000001"; request.noteHeader="300"; request.zawbs="1"; request.zcjsqdm="123456789"; request.zkpje="123456"; 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)