Say*_*yya 7 linkedin linkedin-api
我使用Zoonman LinkedIn API PHP SDK来获取有关经过身份验证的用户是管理员的公司的信息,使用以下代码:
$profileCompany = $client->get(
'companies',
['is-company-admin' => "true"]
);
Run Code Online (Sandbox Code Playgroud)
这与API版本V1完美配合.但是,对于V2,它会给出400未找到的错误.我遇到了这样的问题:组织查找API但不确定这是否是正确的端点,因为没有API调用来完全按照上面的代码片段执行操作.
有人可以请求正确的端点吗?
如果您有来自用户的访问令牌,则可以在LinkedIn API的v2中实现。看到:
https://developer.linkedin.com/docs/guide/v2/organizations/organization-lookup-api#acls
基本请求的完整URL为:
https://api.linkedin.com/v2/organizationalEntityAcls?q=roleAssignee&role=ADMINISTRATOR&state=APPROVED&projection=(*,elements*(*,organizationalTarget~(*)))
Run Code Online (Sandbox Code Playgroud)
使用分页:
https://api.linkedin.com/v2/organizationalEntityAcls?q=roleAssignee&role=ADMINISTRATOR&state=APPROVED&projection=(*,elements*(*,organizationalTarget~(*)))&start=[...]&count=[...]
Run Code Online (Sandbox Code Playgroud)
您可能还希望组织徽标网址:
https://api.linkedin.com/v2/organizationalEntityAcls?q=roleAssignee&role=ADMINISTRATOR&state=APPROVED&projection=(*,elements*(*,organizationalTarget~(*,logoV2(original~:playableStreams,cropped~:playableStreams,cropInfo))))&start=[...]&count=[...]
Run Code Online (Sandbox Code Playgroud)
对于linkedin-api-php-client,另请参见:https : //github.com/zoonman/linkedin-api-php-client/issues/31
来自文档
从 LinkedIn API 平台 v1 迁移应用程序时,请注意以下更改:
Company Pages and Showcase Pages are now surfaced as Organization and Brand resources, respectively. Both resources are considered "Organizational Entities," and share common fields and similarities in how data is accessed.
URNs uniquely identify organizational entities, and can be generated with existing company or showcase ids:
Organization: urn:li:organization:{company id}
The above code make call the rest api "List all companies that the member is an administrator of". It does not seems have a direct equivalent API available in v2.
Organisation lookup/search APIs seems nearest alternative.
Hope this helps.
| 归档时间: |
|
| 查看次数: |
933 次 |
| 最近记录: |