没有足够的权限访问:POST /邀请

时间:2019-02-21 19:20:35

标签: linkedin linkedin-api linkedin-jsapi linkedin-j spring-social-linkedin

无法发送邀请。令牌正确/未过期。

权限:

  • r_ads
  • w_organization_social
  • rw_ads
  • r_basicprofile
  • r_ads_reporting
  • r_organization_social
  • rw_organization_admin
  • w_member_social

添加的产品:

  • 市场开发人员平台
  • 在LinkedIn上分享

代码:

    $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();

我大多只是想知道与谁联系以获得正确的权限。客户服务不处理任何与开发相关的问题。

0 个答案:

没有答案