淘宝联盟淘宝客私域⽤户管理百川SDK接⼊简介
curl -i -d "code=OxlukWofLrB1Db1M6aJGF8x2332458&grant_type=authorization_code&client_id=23075594&
client_secret=69a1469a1469a1469a14a9bf269a14&redirect_uri=www.oauth/2/ "oauth.taobao/token
// 获取sessionKey
$url = 'oauth.taobao/token';
$postfields = [
'client_id' => '4234234',
'client_secret' => 'fsdfsdfsdf234sdf2rwef2er23rwe23r2',
'grant_type' => 'authorization_code',
'code' => $code,
'redirect_uri' => 'www.fdsfsf/taoke/tkcode',
'view' => 'wap'
];
$post_data = '';
foreach ($postfields as $key => $value) {
$post_data .= "$key=" . urlencode($value) . "&";
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, substr($post_data, 0, -1));
$output = curl_exec($ch);
curl_close($ch);
$result = json_decode($output, true);
sdk百川SDK接⼊的,新的流程,在登录后,需要再次授权才能得到code,从⽽得到需要的sessionKey。有点恶⼼,如果有好的⽅法,请告诉我⼀下,谢谢。官⽅相关⽂档链接:
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论