请求方式:GET
注:请求参数须区分大小写
String url = "https://openapi.dataoke.com/api/goods/get-collection-list";
String appKey = "xxx";
String appSecret = "xxx";
TreeMap<String, String> paraMap = new TreeMap<>();
paraMap.put("version", "v1.0.1");
paraMap.put("appKey", appKey);
paraMap.put("pageId", "1");
paraMap.put("pageSize", "20");
paraMap.put("cid", "1");
String data = ApiClient.sendReq(url, appSecret, paraMap);
SDK调用示例
String appKey = "xxx";
String appSecret = "xxx";
DtkApiClient client = DtkApiClient.getInstance(appKey,appSecret);
DtkGetCollectionListRequest request = new DtkGetCollectionListRequest();
request.setVersion("v1.0.0");
request.setPageId("1");
request.setCid("2");
request.setPageSize(100);
request.setTrailerType(0);
request.setSort("0");
request.setCollectionTimeOrder(10);
DtkApiResponse < DtkPageResponse < DtkGetCollectionListItemResponse >> execute = client.execute(request);
{
"time": 1555641972572,
"code": 0,
"msg": "成功",
"data": {
"list": [
{
"id": 18972318,
"goodsId": "562800541176",
"trailerGoods": 0
}
],
"totalNum": 1,
"pageId": "9100d736bb7868c4"
}
}
{
"msg":"服务器错误",
"code":-1,
"time":1554365022200
}