拒绝访问LinkedIn的API [英] Access denied to call LinkedIn's API

查看:262
本文介绍了拒绝访问LinkedIn的API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照步骤操作,拥有访问令牌( LinkedIn开发人员)。

I followed the steps to have an access token (LinkedIn developer). However, I have an error when I make a call to the API to Search People.

这是我的代码;

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);
});

这是我的错误;

{
  "errorCode": 0,
  "message": "Access to people search denied.",
  "requestId": "DHYNQTZDN8",
  "status": 403,
  "timestamp": 1426519095912
}

有人可以建议我找到解决方案吗?

Could someone advise me to find a solution ?

提前感谢David Meurisse

Thank you in advance, David Meurisse

推荐答案

您需要LinkedIn的特殊许可才能使用People Search API。
https://developer-programs.linkedin.com/documents/people -search-api

You require special permission from LinkedIn to use the People Search API. https://developer-programs.linkedin.com/documents/people-search-api

这篇关于拒绝访问LinkedIn的API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆