根据拼多多商品ID生成多种推广链接,唤起微信推广链接、唤起拼多多客户端推广链接、唤起微博客户端推广链接、小程序推广链接。

1、注册订单侠开放平台账号

注册地址: https://www.dingdanxia.com/user/register/index.html  

2、获取接口秘钥apikey

登录个人中心 - 系统设置 - 接口管理 找到接秘钥apikey,apikey 接口秘钥是调用接口的唯一凭证,请妥善保管! 

3、授权拼多多账号

登录个人中心 - 授权管理 - 拼多多授权, 授权自己的拼多多账号。

4、PHP代码调用示例

<?php
// +----------------------------------------------------------------------
// | 订单侠开放平台 www.dingdanxia.com  [ 专为淘客开发者提供一站式API解决方案 ] 
// +----------------------------------------------------------------------
//接口秘钥
$apikey = '这里填写你的apikey';
//拼多多转链接口
$apiurl = "http://api.tbk.dingdanxia.com/pdd/convert";
 
 
//开始调用
$result = curl_post($apiurl, array(
    //接口秘钥
        "apikey"    => $apikey,
        "p_id"      =>你自己的拼多多推广位
         "goods_id_list"=>商品ID
         
	    
));
 
 
//打印结果
print_r($result);
 
/**
 * post请求
 * @param string $url
 * @param array $params
 * @param int $timeout
 */
function curl_post($url, $params, $timeout = 3) {
    try {
        foreach ($params as $key => $val) {
            $post[] = "{$key}={$val}";
        }
        $post_data  = implode('&', $post);
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
        return curl_exec($ch);
    }
    catch (Exception $e) {
        return false;
    }
}

5、接口返回结果

{
	"code": 200,
	"msg": "请求成功【success】",
	"data": {
		"weibo_app_web_view_short_url": null,
		"mobile_url": "https://mobile.yangkeduo.com/app.html?use_reload=1&launch_url=duo_coupon_landing.html%3Fgoods_id%3D2574921541%26pid%3D8735184_70977074%26authDuoId%3D8516041%26cpsSign%3DCC_200417_8735184_70977074_5479552ed99839af6bc33b7a5bcecc93%26duoduo_type%3D2&campaign=ddjb&cid=launch_dl_force_",
		"goods_id": null,
		"goods_detail": null,
		"url": "https://mobile.yangkeduo.com/duo_coupon_landing.html?goods_id=2574921541&pid=8735184_70977074&authDuoId=8516041&cpsSign=CC_200417_8735184_70977074_5479552ed99839af6bc33b7a5bcecc93&duoduo_type=2",
		"short_url": "https://p.pinduoduo.com/XGGQYJBp",
		"qq_app_info": null,
		"mobile_super_short_url": null,
		"we_app_info": null,
		"schema_url": null,
		"weibo_app_web_view_url": null,
		"mobile_short_url": "https://p.pinduoduo.com/a5aQqnOd",
		"we_app_web_view_url": "https://mobile.yangkeduo.com/duo_coupon_landing.html?goods_id=2574921541&pid=8735184_70977074&authDuoId=8516041&cpsSign=CC_200417_8735184_70977074_5479552ed99839af6bc33b7a5bcecc93&duoduo_type=2",
		"we_app_web_view_short_url": "https://p.pinduoduo.com/XGGQYJBp"
	}
}	

接口文档:https://www.dingdanxia.com/doc/64/86

在线测试:https://www.dingdanxia.com/apitest/64/86