如何使用 LinkedIn People Search API

How to use LinkedIn People Search API

由于 LinkedIn People Search API 截至目前有几项变化,请解释如何使用此 API 按公司搜索人员等...
我已阅读

and other document but not getting connection with search link and API key and all.As explained in document 我们可以搜索一些东西像这样

https://api.linkedin.com/v1/people-search?keywords=Princess

但是我们需要把 API KEY 和所有的东西放在哪里。我是 APIs 的新手,所以请尽可能解释一下。

使用 Postman 来学习这个教程: https://developer.linkedin.com/docs/oauth2

成功后,您可以单击 获取使用 OATH2 创建请求所需的 PHP 代码。我在 LinkedIn 上没有开发者帐户,所以这部分你必须自己做。

示例 GET 请求在 PHP 中如下所示:

第 2 步

<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://www.linkedin.com/uas/oauth2/authorization');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString(array(
  'response_type' => 'code',
  'client_id' => '123456789',
  'redirect_uri' => 'https://www.example.com/auth/linkedin',
  'state' => '987654321',
  'scope' => 'r_basicprofile'
)));

$request->setHeaders(array(
  'cache-control' => 'no-cache'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();

第 3 步

<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://www.linkedin.com/uas/oauth2/accessToken');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString(array(
  'grant_type' => 'authorization_code',
  'code' => '987654321',
  'redirect_uri' => 'https://www.myapp.com/auth/linkedin',
  'client_id' => '123456789',
  'client_secret' => 'shhdonottell'
)));

$request->setHeaders(array(
  'postman-token' => 'bee6f5d7-a0e6-4a76-6ef8-930c95af53a6',
  'cache-control' => 'no-cache',
  'content-type' => 'application/x-www-form-urlencoded',
  'host' => 'www.linkedin.com'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();

自 2015 年 5 月以来,LinkedIn 的人物搜索 API 对开放开发者社区不可用。

您可以申请成为开发者合作伙伴:https://developer.linkedin.com/partner-programs/apply

如果您是 LinkedIn 的官方合作伙伴并且仍然可以访问该 API,您应该跟进您指定的合作伙伴工程代表以获得进一步的帮助,而不是 public 论坛。