登录
退出
首页
开放版图
苏宁有货
商家后台
文档中心
文档中心
API文档
消息中心
平台公告
工单
我的工单
提交工单
控制台
SDK调用示例
suning.custom.effectdata.add/
调用示例(JAVA)
复制全部代码
import com.suning.api.entity.custom.EffectdataAddRequest; import com.suning.api.entity.custom.EffectdataAddResponse; EffectdataAddRequest request = new EffectdataAddRequest(); request.setActivityId("20040614103860942631"); request.setActivityPv("1"); request.setActivityUv("1"); request.setCloudDiamondCount("1"); request.setDate("2021-03-01"); request.setHelpCount("1"); request.setInitInvitationCount("1"); request.setNewJoinedCount("1"); StoreEffectList storeEffectList= new StoreEffectList(); storeEffectList.setCouponCount("1"); GoodsEffectList goodsEffectList= new GoodsEffectList(); goodsEffectList.setGoodsCode("商品编码"); goodsEffectList.setGoodsName("商品名称1"); goodsEffectList.setScanGoodsCount("1"); goodsEffectList.setScanGoodsNewUserCount("1"); goodsEffectList.setScanGoodsUserCount("1"); List
goodsEffectListList =new ArrayList
(); goodsEffectListList.add(goodsEffectList); storeEffectList.setGoodsEffectList(goodsEffectListList); storeEffectList.setJoinedCount("1"); storeEffectList.setNewFansCount("1"); storeEffectList.setNewMemberCount("1"); storeEffectList.setScanStoreCount("1"); storeEffectList.setScanStoreNewUserCount("1"); storeEffectList.setScanStoreUserCount("1"); storeEffectList.setStoreCode("70073822"); storeEffectList.setStoreName("云南松下冰箱"); storeEffectList.setStoreNewJoinedCount("1"); List
storeEffectListList =new ArrayList
(); storeEffectListList.add(storeEffectList); request.setStoreEffectList(storeEffectListList); request.setXhJoinedCount("1"); request.setXhNewJoinedCount("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 { EffectdataAddResponse response = client.excute(request); System.out.println("返回json/xml格式数据 :" + response.getBody()); } catch (SuningApiException e) { e.printStackTrace(); }
调用示例(PHP)
复制全部代码
$req = new EffectdataAddRequest(); $req -> setActivityId("20040614103860942631"); $req -> setActivityPv("1"); $req -> setActivityUv("1"); $req -> setCloudDiamondCount("1"); $req -> setDate("2021-03-01"); $req -> setHelpCount("1"); $req -> setInitInvitationCount("1"); $req -> setNewJoinedCount("1"); $storeEffectList= new StoreEffectList(); $storeEffectList-> setCouponCount("1"); $goodsEffectList= new GoodsEffectList(); $goodsEffectList-> setGoodsCode("商品编码"); $goodsEffectList-> setGoodsName("商品名称1"); $goodsEffectList-> setScanGoodsCount("1"); $goodsEffectList-> setScanGoodsNewUserCount("1"); $goodsEffectList-> setScanGoodsUserCount("1"); $storeEffectList-> setGoodsEffectList(array($goodsEffectList)); $storeEffectList-> setJoinedCount("1"); $storeEffectList-> setNewFansCount("1"); $storeEffectList-> setNewMemberCount("1"); $storeEffectList-> setScanStoreCount("1"); $storeEffectList-> setScanStoreNewUserCount("1"); $storeEffectList-> setScanStoreUserCount("1"); $storeEffectList-> setStoreCode("70073822"); $storeEffectList-> setStoreName("云南松下冰箱"); $storeEffectList-> setStoreNewJoinedCount("1"); $req -> setStoreEffectList(array($storeEffectList)); $req -> setXhJoinedCount("1"); $req -> setXhNewJoinedCount("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; EffectdataAddRequest request = new EffectdataAddRequest(); request.activityId="20040614103860942631"; request.activityPv="1"; request.activityUv="1"; request.cloudDiamondCount="1"; request.date="2021-03-01"; request.helpCount="1"; request.initInvitationCount="1"; request.newJoinedCount="1"; EffectdataAddStoreEffectListReq storeEffectList= new EffectdataAddStoreEffectListReq(); storeEffectList.couponCount="1"; EffectdataAddGoodsEffectListReq goodsEffectList= new EffectdataAddGoodsEffectListReq(); goodsEffectList.goodsCode="商品编码"; goodsEffectList.goodsName="商品名称1"; goodsEffectList.scanGoodsCount="1"; goodsEffectList.scanGoodsNewUserCount="1"; goodsEffectList.scanGoodsUserCount="1"; List
goodsEffectListList =new ArrayList
(); goodsEffectListList.add(goodsEffectList); storeEffectList.goodsEffectList=goodsEffectListList; storeEffectList.joinedCount="1"; storeEffectList.newFansCount="1"; storeEffectList.newMemberCount="1"; storeEffectList.scanStoreCount="1"; storeEffectList.scanStoreNewUserCount="1"; storeEffectList.scanStoreUserCount="1"; storeEffectList.storeCode="70073822"; storeEffectList.storeName="云南松下冰箱"; storeEffectList.storeNewJoinedCount="1"; List
storeEffectListList =new ArrayList
(); storeEffectListList.add(storeEffectList); request.storeEffectList=storeEffectListList; request.xhJoinedCount="1"; request.xhNewJoinedCount="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); EffectdataAddResponse response = client.Execute(request);
调用示例(PYTHON)
复制全部代码
# -*- coding: utf-8 -*- import suning.api request = suning.api.custom.EffectdataAddRequest() request.activityId="20040614103860942631"; request.activityPv="1"; request.activityUv="1"; request.cloudDiamondCount="1"; request.date="2021-03-01"; request.helpCount="1"; request.initInvitationCount="1"; request.newJoinedCount="1"; request. storeEffectList= [{ couponCount:"1", goodsEffectList: [{ goodsCode:"商品编码", goodsName:"商品名称1", scanGoodsCount:"1", scanGoodsNewUserCount:"1", scanGoodsUserCount:"1", }], joinedCount:"1", newFansCount:"1", newMemberCount:"1", scanStoreCount:"1", scanStoreNewUserCount:"1", scanStoreUserCount:"1", storeCode:"70073822", storeName:"云南松下冰箱", storeNewJoinedCount:"1", }]; request.xhJoinedCount="1"; request.xhNewJoinedCount="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)