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

{{item.type_name}}:

API 市场 / 口令解析
 

口令解析
吐槽建议
应用场景:
从其他渠道获取热门商品口令,自己也想推广。则可以用此接口进行解析出对应商品id/活动id进行转链
接口说明:
支持各种口令的解析,解析出对于商品、优惠券、pid或者是活动会场ID等信息
使用人数: 4000+
口令解析 接口测试 建议使用通用GET方法调用
  • 接口说明
  • 更新日志
  • 接口版本号:v1.0.0

请求地址:https://openapi.dataoke.com/api/tb-service/parse-taokouling 复制

请求方式:GET

公共参数:
请求参数:

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

返回数据:
调用示例:
String url = "https://openapi.dataoke.com/api/tb-service/parse-taokouling";
String appKey = "xxx";
String appSecret = "xxx";
TreeMap<String, String> paraMap = new TreeMap<>();
paraMap.put("version", "v1.0.0");
paraMap.put("appKey", appKey);
paraMap.put("content", "复制这段描述¥s3QN1y1t3qDu¥");
String data = ApiClient.sendReq(url, appSecret, paraMap);

SDK调用示例
String appKey = "xxx";
String appSecret = "xxx";
DtkApiClient client = DtkApiClient.getInstance(appKey,appSecret);
DtkParseTaokoulingRequest request = new DtkParseTaokoulingRequest();
request.setVersion("v1.0.0");
request.setContent("复制这段描述¥s3QN1y1t3qDu¥");
DtkApiResponse < DtkParseContentResponse > execute = client.execute(request);
 //淘口令解析
    $data = [
        'appKey' => "xxxxxxxxxxxx",
        'version' => "v1.0.0",
        ...
    ];
    $host = "https://openapi.dataoke.com/api/tb-service/parse-taokouling";
    $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 GetParseTpwd();
    $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 {
		"content": "639331017111",
	}

	// 4.业务请求,示例使用淘口令解析和淘系万能解析接口,其它开放接口使用方法相同
	resp, err := client.ParseTaoKouLing(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)
}
返回示例:
{
    "code": 0,
    "data": {
        "commissionRate": 20,
        "commissionType": "MKT",
        "goodsId": "541297998676",
        "originInfo": {
            "activityId": "0f75a182319b422a8a2daa57245e21a7",
            "amount": 3,
            "endTime": "2020-07-28 23:59:59",
            "image": "https://img.alicdn.com/bao/uploaded/i1/3017400344/O1CN01tFqf3G1EParIBkZXM_!!0-item_pic.jpg",
            "pid": "mm_30330467_520850264_108918300378",
            "price": 34.83,
            "shopLogo": "https://gw.alicdn.com//92/ab/TB1bIGGOXXXXXasXFXXSutbFXXX.jpg",
            "shopName": "好欢螺旗舰店",
            "startFee": 30,
            "startTime": "2020-07-22 00:00:00",
            "status": 0,
            "title": "好欢螺螺蛳粉柳州特产螺狮粉酸辣粉300gx3袋速食螺丝粉方便面米线"
        },
        "originType": "二合一券",
        "originUrl": "https://uland.taobao.com/coupon/edetail?e=GRpMEmIn6G4GQASttHIRqVyBQFbzEoB7yE8ze9rkZCTDLwEgKWfbRfj%2BE%2FMkGpW5Na4vajnw0JotkFtpL6gEnbNcupgyd%2B1qWv9OAj9evKDahba4h8MrZ%2Bdth9k8bqqSHKTgBzHkoM7XTQC0vfau6E%2F9Zk7cDx8UPrKiYwdarE%2FmZlrHb6YhPHui%2Fn%2FQ7Z5Vh4inBowG%2Bk%2Bz%2BEEIX1kmAg%3D%3D&traceId=0bb6a98415953819325498447e4db4&union_lens=lensId:TAPI@1595381932@0b5a317b_0d7a_173742c621c_d260@01&xId=5KcVIs0vBgEM4iUVFITEfr00ZdvkqiPbSU4ZYKwhY83jyw90hAx9uZXdiJu2IM54M8WcpeRRhiXmcFsYcJnf2MARapaCrMnBo1oLW4o71HW1&activityId=0f75a182319b422a8a2daa57245e21a7&src=qhkj_dtkp&un=2e11e09e6bec9bc14623f433a4270ff2&share_crt_v=1&ut_sk=1.utdid_28131718_1595381932648.TaoPassword-Outside.taoketop&spm=a2159r.13376465.0.0&sp_tk=ZHlsdDFBY3gwUU8=&bxsign=tcd15953838702565fb790aed72a00bbf65fe2e0c8874434"
    },
    "msg": "成功",
    "time": 1595383870566
}
常见错误码:
{
    "code": 20001,
    "msg": "淘口令无效或已过期",
    "time": 1594865368702
}
错误码列表: