大淘客,让选品更简单! |

{{item.type_name}}:

API 市场 / 活动商品
 

活动商品
吐槽建议
应用场景:
用于导购平台的活动推广专区,调用接口获取大淘客热门活动
接口说明:
通过热门活动接口获取到的活动ID,根据活动ID可以获取活动下的所有商品合集
使用人数: 5000+
活动商品 接口测试 建议使用通用GET方法调用
  • 接口说明
  • 更新日志
  • 接口版本号:v1.2.2

请求地址:https://openapi.dataoke.com/api/goods/activity/goods-list 复制

请求方式:GET

公共参数:
请求参数:

注:请求参数须区分大小写

返回数据:
调用示例:
String url = "https://openapi.dataoke.com/api/goods/activity/goods-list";
String appKey = "xxx";
String appSecret = "xxx";
TreeMap<String, String> paraMap = new TreeMap<>();
paraMap.put("version", "v1.2.2");
paraMap.put("appKey", appKey);
paraMap.put("pageId", "1");
paraMap.put("activityId", "20");
String data = ApiClient.sendReq(url, appSecret, paraMap);

SDK调用示例
String appKey = "xxx";
String appSecret = "xxx";
DtkApiClient client = DtkApiClient.getInstance(appKey,appSecret);
DtkActivityGoodsListRequest request = new DtkActivityGoodsListRequest();
request.setPageId("1");
request.setActivityId(20);
request.setPageSize(100);
request.setCid(1);
request.setSubcid(1);
request.setFreeshipRemoteDistrict(1);
DtkApiResponse < DtkPageResponse < DtkActivityGoodsListResponse >> execute = client.execute(request);
    //活动商品
    $data = [
        'appKey' => "xxxxxxxxxxxx",
        'version' => "v1.2.2",
        ...
    ];
    $host = "https://openapi.dataoke.com/api/goods/activity/goods-list";
    $url = $host . '?' . http_build_query($data);
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    $output = curl_exec($ch);
    $a = curl_error($ch);
    if(!empty($a)){
        return json_encode(array('code'=>10003, 'msg'=>$a));
    }
    curl_close($ch);
    return $output;

    SDK调用示例
    $client = new GetActivityGoodsList();
    $client->setAppKey("xxxxxxxxx");
    $client->setAppSecret("xxxxxxxxxxxxxxxxxxxxxxxxx");
    $client->setVersion("v1.2.2");

    $res = $client->setParams([])->request();
package main

import (
	"fmt"
	"gitee.com/dtk-developer/openapi-sdk-go/sdk"
)

func main() {
	// 1.初始化所需要的参数appKey, appSecret, version
	var (
		appKey = "xxxxxxxxxx"
		appSecret = "xxxxxxxxxx"
		version = "v1.3.1"
	)

	// 2.初始化开放平台api的客户端句柄
	oa := &sdk.OpenApi{}
	oa.AppKey = appKey
	oa.AppSecret = appSecret
	oa.Version = version
	client :=  oa.GetClient()

	// 3.准备请求参数
	params := map[string]string {
		"pageId": "1",
	}

	// 4.业务请求,示例使用活动商品和淘系万能解析接口,其它开放接口使用方法相同
	resp, err := client.ActivityGoodsList(params)
	if err != nil {
		panic(err)
	}
	fmt.Println(resp)

	// 复用client句柄
	params = map[string]string {
		// 指定接口版本
		"version": "v1.0.0",
		"content": "1👈¥fym8XiJU9Oi¥ https://s.click.taobao.com/Ys3TNlu  包邮 漫花抽纸10包4层加厚280张/包纸巾卫生纸家用实惠装面巾纸",
	}
	resp, err = client.ParseContent(params)
	if err != nil {
		panic(err)
	}
	fmt.Println(resp)
}
返回示例:
{
    "time":1554711897417,
    "code":0,
    "msg":"成功",
    "data":{
        "list":[
            {
            "id": 21623438,
			"goodsId": "527388290525",
			"title": "南极人男士内裤男生平角裤衩纯棉潮流个性骚夏天透气薄款四角裤头",
			"dtitle": "南极人男士夏天平角透气个性内裤",
			"originalPrice": 49.9,
			"actualPrice": 29.9,
			"shopType": 1,
			"goldSellers": 0,
			"monthSales": 33448,
			"twoHoursSales": 0,
			"dailySales": 0,
			"commissionType": 3,
			"desc": "【南极人品牌】【4条装,赶紧抢】舒适面料,干爽透气,柔软有弹性,柔软亲肤,莫代尔,冰丝都有,轻薄透气,款式多,尺码全。透气性好,不闷热,洗了不褪色,手慢无【赠送运费险】",
			"couponReceiveNum": 0,
			"couponLink": "https://uland.taobao.com/quan/detail?sellerId=2430420260&activityId=9e40ea87fca441539820e2b22ad7f4bb",
			"couponEndTime": "2019-08-20 23:59:59",
			"couponStartTime": "2019-08-15 00:00:00",
			"couponPrice": 20.0,
			"couponConditions": "49",
			"activityType": 1,
			"createTime": "2019-08-14 15:29:08",
			"mainPic": "https://img.alicdn.com/imgextra/i3/4226848392/O1CN01WiDY5H2BraJxnJpp3_!!4226848392.jpg",
			"marketingMainPic": "https://sr.ffquan.cn/relate_pic/o_1di7gdeeb8s2fn1cfq1m5d1g90d.jpg",
			"sellerId": "2430420260",
			"cid": 10,
			"discounts": 0.6,
			"commissionRate": 20.0,
			"couponTotalNum": 100000,
			"haitao": 0,
			"activityStartTime": "",
			"activityEndTime": "",
			"shopName": "南极人双鸿专卖店",
			"shopLevel": 16,
			"descScore": 4.8,
			"brand": 1,
			"brandId": 107380,
			"brandName": "南极人",
			"hotPush": 0,
			"teamName": "德合联盟",
			"itemLink": "https://detail.tmall.com/item.htm?id=527388290525",
			"tchaoshi": 0,
			"detailPics": "",
			"dsrScore": -1,
			"dsrPercent": -1,
			"shipScore": -1,
			"shipPercent": -1,
			"serviceScore": -1,
			"servicePercent": -1,
			"subcid": [97426],
			"tbcid": 50008882,
			"quanMLink":10,
			"hzQuanOver":100,
			"yunfeixian":1,
			"estimateAmount":0,
			"shopLogo": "https://img.alicdn.com/imgextra//59/df/TB1lJVxNFXXXXcoXFXXSutbFXXX.jpg",
			"freeshipRemoteDistrict": 0
            }
        ],
        "totalNum":16499,
        "pageId":"76679471048598b0"
    }
}
常见错误码:
{
    "msg":"服务器错误",
    "code":-1,
    "time":1554365022200
}
错误码列表: