[英]Access denied to call LinkedIn's API
I followed the steps to have an access token ( LinkedIn developer ). 我按照步骤获得访问令牌( LinkedIn开发人员 )。 However, I have an error when I make a call to the API to Search People. 但是,当我调用API来搜索人物时出现错误。
This is my code ; 这是我的代码;
Route::post('research', function()
{
$c = curl_init();
$firstName = Request::input('firstName'); $lastName = Request::input('lastName');
$resource = '&first-name='.$firstName.'&last-name='.$lastName.'&sort=connections';
$params = array(
'oauth2_access_token' => Session::get('access_token'),
'format' => 'json',
);
$postdata = http_build_query($params);
$url = 'https://api.linkedin.com/v1/people-search?'.$postdata.$resource;
curl_setopt($c, CURLOPT_URL, $url);
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
curl_setopt($c, CURLOPT_HEADER, true);
$output = curl_exec($c);
if($output === false)
{
trigger_error('Erreur curl : '.curl_error($c),E_USER_WARNING);
exit('error');
}else{
var_dump($output);
exit('result');
}
curl_close($c);
});
And this is my error ; 这是我的错误;
{
"errorCode": 0,
"message": "Access to people search denied.",
"requestId": "DHYNQTZDN8",
"status": 403,
"timestamp": 1426519095912
}
Could someone advise me to find a solution ? 有人可以建议我找到解决方案吗?
Thank you in advance, David Meurisse 预先谢谢大卫·梅里斯(David Meurisse)
You require special permission from LinkedIn to use the People Search API. 您需要获得LinkedIn的特殊许可才能使用People Search API。 https://developer-programs.linkedin.com/documents/people-search-api https://developer-programs.linkedin.com/documents/people-search-api
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.