无法获取 LinkedIn API 版本 V2 的公司
Unable to get companies for LinkedIn API version V2
我使用 Zoonman LinkedIn API PHP SDK 获取有关经过身份验证的用户是其管理员的公司的信息,使用这段代码:
$profileCompany = $client->get(
'companies',
['is-company-admin' => "true"]
);
这与 API 版本 V1 完美配合。但是,对于 V2,它会给出 400 not found 错误。我遇到了这个:Organization Lookup API 但不确定这是否是正确的端点,因为没有 API 调用来完全执行上述代码片段的操作。
有人可以帮助正确的端点吗?
来自docs
Please note the following changes when migrating your app from v1 of
the LinkedIn API Platform:
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}
上面的代码调用剩下的api“List all companies that the member is an administrator of”。 v2.
中似乎没有直接等效的 API
组织 lookup/search APIs 似乎是最近的选择。
希望对您有所帮助。
如果您有来自用户的访问令牌,这在 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~(*)))
有分页:
https://api.linkedin.com/v2/organizationalEntityAcls?q=roleAssignee&role=ADMINISTRATOR&state=APPROVED&projection=(*,elements*(*,organizationalTarget~(*)))&start=[...]&count=[...]
您可能还需要组织徽标网址:
https://api.linkedin.com/v2/organizationalEntityAcls?q=roleAssignee&role=ADMINISTRATOR&state=APPROVED&projection=(*,elements*(*,organizationalTarget~(*,logoV2(original~:playableStreams,cropped~:playableStreams,cropInfo))))&start=[...]&count=[...]
对于 linkedin-api-php-client 另请参阅:
https://github.com/zoonman/linkedin-api-php-client/issues/31
我使用 Zoonman LinkedIn API PHP SDK 获取有关经过身份验证的用户是其管理员的公司的信息,使用这段代码:
$profileCompany = $client->get(
'companies',
['is-company-admin' => "true"]
);
这与 API 版本 V1 完美配合。但是,对于 V2,它会给出 400 not found 错误。我遇到了这个:Organization Lookup API 但不确定这是否是正确的端点,因为没有 API 调用来完全执行上述代码片段的操作。
有人可以帮助正确的端点吗?
来自docs
Please note the following changes when migrating your app from v1 of the LinkedIn API Platform:
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}
上面的代码调用剩下的api“List all companies that the member is an administrator of”。 v2.
中似乎没有直接等效的 API组织 lookup/search APIs 似乎是最近的选择。
希望对您有所帮助。
如果您有来自用户的访问令牌,这在 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~(*)))
有分页:
https://api.linkedin.com/v2/organizationalEntityAcls?q=roleAssignee&role=ADMINISTRATOR&state=APPROVED&projection=(*,elements*(*,organizationalTarget~(*)))&start=[...]&count=[...]
您可能还需要组织徽标网址:
https://api.linkedin.com/v2/organizationalEntityAcls?q=roleAssignee&role=ADMINISTRATOR&state=APPROVED&projection=(*,elements*(*,organizationalTarget~(*,logoV2(original~:playableStreams,cropped~:playableStreams,cropInfo))))&start=[...]&count=[...]
对于 linkedin-api-php-client 另请参阅: https://github.com/zoonman/linkedin-api-php-client/issues/31