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

{{item.type_name}}:

API 市场 / 礼金创建
 

礼金创建
吐槽建议
应用场景:
当需要推广某些单品使用到淘礼金时,可以调用本接口创建淘礼金
接口说明:
接口主要用于淘礼金的创建 (淘礼金本质上是一种有跟踪能力的权益产品,由淘宝客推广者出资,充值,绑定单品后生成淘礼金红包领取中间页链接。在符合相应推广标准的情况下,淘礼金的结算优先级最高)
使用人数: 1000+
礼金创建 接口测试 建议使用通用GET方法调用
  • 接口说明
  • 更新日志
  • 接口版本号:v1.0.0

请求地址:https://openapi.dataoke.com/api/dels/taobao/kit/create-tlj 复制

请求方式:GET

公共参数:
请求参数:

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

返回数据:
调用示例:
String url = "https://openapi.dataoke.com/api/dels/taobao/kit/create-tlj";
String appKey = "xxx";
String appSecret = "xxx";
TreeMap<String, String> paraMap = new TreeMap<>();
paraMap.put("version", "v1.0.0");
paraMap.put("alimamaAppKey", "xxxx");
paraMap.put("alimamaAppSecret", "xxxx");
paraMap.put("itemId", "xxxx");
paraMap.put("name", "xxxx");
paraMap.put("campaignType", "xxxx");
paraMap.put("perFace", 1);
paraMap.put("totalNum", 1);
paraMap.put("winNumLimit", 1);
paraMap.put("sendStartTime", "2020-12-30 12:00:00");
paraMap.put("sendEndTime", "2020-12-30");
paraMap.put("useEndTimeMode", 1);
paraMap.put("useStartTime", "xxxx");
paraMap.put("userEndTime", "xxxx");
paraMap.put("securityLevel", 1);
paraMap.put("securitySwitch", 1);
paraMap.put("pid", "xxxx");
String data = ApiClient.sendReq(url, appSecret, paraMap);

SDK调用示例
String appKey = "xxx";
String appSecret = "xxx";
DtkApiClient client = DtkApiClient.getInstance(appKey,appSecret);
DtkTbCashGiftRequest request = new DtkTbCashGiftRequest();
request.setVersion("v1.0.0");
request.setAlimamaAppKey("https://survey.taobao.com/apps/zhiliao/BQ2RPRlpU");
request.setAlimamaAppSecret("xxxx");
request.setName("xxx");
request.setItemId("xxx_1");
request.setPerFace("10.00");
request.setTotalNum(1);
request.setWinNumLimit(1);
request.setSendStartTime("2021-07-15 16:00:00");
request.setSendEndTime("2021-07-15 16:40:00");
request.setPid("mm_27399943_1915200219_110990500489");
request.setCampaignType(1);
request.setUseEndTimeMode("1");
request.setUseStartTime("3");
request.setUserEndTime("3");
DtkApiResponse < DtkTbCashGiftResponse > execute = client.execute(request);
    //淘礼金创建
    $data = [
        'appKey' => "xxxxxxxxxxxx",
        'version' => "v1.0.0",
        ...
    ];
    $host = "https://openapi.dataoke.com/api/dels/taobao/kit/create-tlj";
    $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 GetCreateTlj();
    $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 {
		"alimamaAppKey": "639331017111",
                "alimamaAppSecret": "alimamaA小学生ds哒",
	}

	// 4.业务请求,示例使用淘礼金创建和淘系万能解析接口,其它开放接口使用方法相同
	resp, err := client.CreateTlj(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": "aebc263a6c61435aa674a083a8e19703",
    "time": 1609300259661,
    "code": 0,
    "msg": "成功",
    "data": {
        "rightsId": "YdZGbHSRRV0L%2BobGZwG2WczTPWDIp1%2Bz",
        "sendUrl": "https://uland.taobao.com/taolijin/edetail?vegasCode=9A24PX2K&type=qtz&union_lens=lensId%3A212c3a2a_1434_176b1c52acb_7195%3Btraffic_flag%3Dlm",
        "tpwd": "5¥IBoOcITuOy6¥/",
        "longTpwd": "53.0¥IBoOcITuOy6¥钉开Τao宝或點҉击҉链节 https://m.tb.cn/h.4SfjxPX 至浏łan器【點击“打开”查看并浏览页面详情,精选商品任您选购】/"
    }
}
常见错误码:
{
msg: "服务器错误",
code: -1,
time: 1554365022200
}
错误码列表: