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

{{item.type_name}}:

API 市场 / 单个专辑商品列表
 

单个专辑商品列表
吐槽建议
应用场景:
可用于应用内营销专区的搭建,或者用于社群内的精推
接口说明:
接口返回某个指定专辑内所有的商品列表及商品详情,大牛选品,质量保证,高佣高转化
使用人数: 1000+
单个专辑商品列表 接口测试 建议使用通用GET方法调用
  • 接口说明
  • 更新日志
  • 接口版本号:v1.0.0

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

请求方式:GET

公共参数:
请求参数:

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

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

SDK调用示例
String appKey = "xxx";
String appSecret = "xxx";
DtkApiClient client = DtkApiClient.getInstance(appKey,appSecret);
DtkSingleAlbumCommodityRequest request = new DtkSingleAlbumCommodityRequest();
request.setAlbumId(42707);
DtkApiResponse < DtkSingleAlbumCommodityResponse > execute = client.execute(request);
    //单个专辑商品列表
    $data = [
        'appKey' => "xxxxxxxxxxxx",
        'version' => "v1.0.0",
        ...
    ];
    $host = "https://openapi.dataoke.com/api/album/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 GetAlbumGoodsList();
    $client->setAppKey("xxxxxxxxx");
    $client->setAppSecret("xxxxxxxxxxxxxxxxxxxxxxxxx");
    $client->setVersion("v1.0.0");

    $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 {
		"albumId": "42707",
	}

	// 4.业务请求,示例使用单个专辑商品列表和淘系万能解析接口,其它开放接口使用方法相同
	resp, err := client.AlbumGoodsList(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)
}
返回示例:
{
    "requestId": "bbf736a212134e51a611c92d272d5555",
    "time": 1608089946271,
    "code": 0,
    "msg": "成功",
    "data": {
        "albumId": 42707,
        "albumName": "饼干糕点今日热卖榜,实时更新",
        "userName": "大淘类目菌",
        "headImg": "https://sr.ffquan.cn/bxk_mall/20200410/bq7t7bsq57bsuglic8v00.png",
        "userGoodAt": [
            "美妆",
            "美食"
        ],
        "goodsCount": 20,
        "releaseTime": "2020-04-22 13:34:35",
        "endTime": "",
        "goodsList": [
            {
                "id": -1,
                "goodsId": "594036262947",
                "title": "【第二件半价第三件0元】法丽兹95g网红零食小吃抹茶夹心饼干曲奇",
                "mainPic": "https://img.alicdn.com/imgextra/i4/2651851491/O1CN01Iy8vMX1Msv9xSi7tB_!!2651851491.jpg",
                "specialText": [],
                "originPrice": 15.90,
                "actualPrice": 10.90,
                "activityType": 1,
                "shopType": 1,
                "monthSales": 218000,
                "dailySales": 191,
                "couponId": "317e417b544e484788575b1054d2fc61",
                "couponLink": "https://uland.taobao.com/quan/detail?sellerId=2651851491&activityId=317e417b544e484788575b1054d2fc61",
                "couponPrice": 5.00,
                "couponReceiveNum": 12900,
                "couponTotalNum": 30000,
                "commissionRate": 1.25,
                "discount": 0.6
            }
        ]
    }
}
常见错误码:
{
msg: "服务器错误",
code: -1,
time: 1554365022200
}
错误码列表: