淘宝客高级接口 阿里妈妈高级接口调用示例 淘宝客高佣转链接口 淘宝客订单接口

 

<?php
// +----------------------------------------------------------------------
// | 订单侠开放平台 www.dingdanxia.com  [ 专为淘客开发者提供一站式API解决方案 ] 
// +----------------------------------------------------------------------
// | 高佣转链、订单查询、淘口令转换、超级搜索、渠道管理、商品详情、黑科技口令 ....
// +----------------------------------------------------------------------
// | wechat: yaotuhao
// +----------------------------------------------------------------------
// 1、高佣转链   http://www.dingdanxia.com/doc/2/8 
// +----------------------------------------------------------------------
// 2、订单查询   http://www.dingdanxia.com/doc/4/8
// +----------------------------------------------------------------------
// 3、淘口令转换 http://www.dingdanxia.com/doc/3/8
// +----------------------------------------------------------------------
// 4、超级搜索   http://www.dingdanxia.com/doc/15/8
// +----------------------------------------------------------------------
// 5、渠道管理   http://www.dingdanxia.com/apidocument/27
// +----------------------------------------------------------------------
// 6、商品详情   http://www.dingdanxia.com/doc/16/8
// +----------------------------------------------------------------------
// 7、黑科技口令 http://www.dingdanxia.com/doc/24/9
// +----------------------------------------------------------------------
// 8、淘口令解析 http://www.dingdanxia.com/doc/5/9
// +----------------------------------------------------------------------

// ========================= php 代码调用demo =============================

//apikey 申请地址: http://open.dingdanxia.com/user/register/index.html
$apikey 	  = '你的apikey';
//默认不需要次参数
$token        = '你的token';

//根据商品ID获得高拥转链
echo do_api("http://api.tbk.dingdanxia.com/tbk/id_privilege",
	array(
	'apikey' => $apikey,
	'id'     => '578939283519',
	'tpwd'   => true,
), $token);



//生成签名
function create_sign($data, $token)
{
	ksort($data);
	return md5(http_build_query( $data ) . '&token='. $token);
}

//调用接口函数
function do_api($url, $data, $token)
{
	$data['signature'] =  create_sign($data, $token);
	return http_post($url, $data);
}

//CURL POST
function http_post($url,$param,$post_file=false,$header = null){
    $oCurl = curl_init();
    if (is_array($header)) {
        curl_setopt($oCurl, CURLOPT_HTTPHEADER, $header); 
    }
    if(stripos($url,"https://")!==FALSE){
        curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, FALSE);
        curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, false);
        curl_setopt($oCurl, CURLOPT_SSLVERSION, 1); //CURL_SSLVERSION_TLSv1
    }
    if (is_string($param) || $post_file) {
        $strPOST = $param;
    } else {
        $aPOST = array();
        foreach($param as $key=>$val){
            $aPOST[] = $key."=".urlencode($val);
        }
        $strPOST =  join("&", $aPOST);
    }
    curl_setopt($oCurl, CURLOPT_URL, $url);
    curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, 1 );
    curl_setopt($oCurl, CURLOPT_POST,true);
    curl_setopt($oCurl, CURLOPT_POSTFIELDS,$strPOST);
    $sContent = curl_exec($oCurl);
    $aStatus = curl_getinfo($oCurl);
    curl_close($oCurl);
    if(intval($aStatus["http_code"])==200){
        return $sContent;
    }else{
        return false;
    }
}

接口文档:https://www.dingdanxia.com/apidocument

实付0元
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值