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

{{item.type_name}}:

API 市场 / 口令转口令
 

口令转口令
吐槽建议
应用场景:
从其他渠道获取热门商品,如果文案中有口令。则可以用此接口直接把口令转成自己的,便于自购或者二次推广
接口说明:
把用户从其他渠道获得到口令转换为用户自己的口令,便于用户二次推广
使用人数: 3000+
口令转口令 接口测试 建议使用通用GET方法调用
  • 接口说明
  • 更新日志
  • 接口版本号:v1.0.0

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

请求方式:GET

公共参数:
请求参数:

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

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

SDK调用示例
String appKey = "xxx";
String appSecret = "xxx";
DtkApiClient client = DtkApiClient.getInstance(appKey,appSecret);
DtkTwdToTwdRequest request = new DtkTwdToTwdRequest();
request.setVersion("v1.0.0");
request.setContent("复制这条信息,打开手机淘宝领券下单(4j9ZXjl7pel):/");
request.setPid("mm_27399943_1915200219_110990500489");
request.setChannelId("0");
request.setSpecial_id("0");
request.setExternal_id("0");
DtkApiResponse < DtkTwdToTwdResponse > execute = client.execute(request);
 //淘口令转淘口令
    $data = [
        'appKey' => "xxxxxxxxxxxx",
        'version' => "v1.0.0",
        ...
    ];
    $host = "https://openapi.dataoke.com/api/tb-service/twd-to-twd";
    $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 GetTwdToTwd();
    $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.0.0"
	)

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

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

	// 4.业务请求,示例使用高效转链和淘系万能解析接口,其它开放接口使用方法相同
	resp, err := client.TwdToTwd(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": 1597312154111,
    "code": 0,
    "msg": "成功",
    "data": {
        "couponClickUrl": "",
        "couponEndTime": "",
        "couponInfo": "",
        "couponStartTime": "",
        "itemId": "577582267511",
        "couponTotalCount": "",
        "couponRemainCount": "",
        "originUrl": "https://uland.taobao.com/coupon/edetail?e=0XTYaxrV4nQGQASttHIRqYLsyl3baZLsB0Kqi0hLZnZWGKUTWWim8zZAq%2BmR21y8ztC5Ka9Rt%2Fn7hHFiLOQ7kRrn5v%2Bgi70NY1kWovEdEWPKdDtLTN7C7%2FsnwWZGSCD41ug731VBEQm0m3Ckm6GN2CwynAdGnOngMmnVmWO1H8vvI9wRv%2BDqFlLajOROSSHl4ncgeMjsGdDyQVoTTYs3iQ%3D%3D&traceId=0bb6ad0215970492414305883eef88&union_lens=lensId:TAPI@1597049241@0b081808_0d3e_173d78d7f6e_9380@01&xId=53dxYB9Rg8iMfaftInhfw9BfakT1XpOOv6EsblxQs0vmeSK9mxlXkmx0CsDO7M9rYHLkRyeWBfjy32briYLet6QogQPJi8xnYHDgYGXCEpen&activityId=fdf21ddd628b4cce8cdff627df62f5ba&src=qhkj_dtkp&un=29d42553880b264c4b68d5f77a161062&share_crt_v=1&ut_sk=1.utdid_23116944_1597049241516.TaoPassword-Outside.taoketop&spm=a2159r.13376465.0.0&sp_tk=cG1jaWNZVHZ2Vjc=&bxsign=tcd1597312152946fc7f667b068b4c009d08dc8e0b66ad20",
        "tpwd": "¥E08xc1WLlOY¥",
        "maxCommissionRate": "0.97",
        "shortUrl": "https://s.click.taobao.com/66XScxu",
        "minCommissionRate": "",
        "title": "包邮认养一头牛常温法式酸奶200g*12盒早餐风味酸牛奶整箱送礼"
    }
}
错误码列表: