无法发送邀请。令牌正确/未过期。
权限:
添加的产品:
代码:
$client = new Client([
'base_uri' => 'https://api.linkedin.com/v2/',
'timeout' => 9.0,
]);
$headers = [
'Connection' => 'Keep-Alive',
'Authorization' => 'Bearer '.$myAccessToken,
];
$body = json_encode([
'invitee' => "urn:li:email:myEmail@test.com",
'message' => [
'com.linkedin.invitations.InvitationMessage' => [
'body' => 'Let\'s connect!'
],
],
]);
// Send an asynchronous request.
$request = new \GuzzleHttp\Psr7\Request('POST', 'invitations', $headers, $body);
$promise = $client->sendAsync($request)->then(function ($response) {
echo 'I completed! ' . $response->getBody();
});
$promise->wait();
我大多只是想知道与谁联系以获得正确的权限。客户服务不处理任何与开发相关的问题。