Derek Joseph Olson
Derek Joseph Olson

Reputation: 778

LinkedIn v2 organization API endpoint failing

I'm currently requesting scopes w_company_admin, r_basicprofile, and rw_organization.

I already posted a similar question here, but I got no support so I'm trying a different approach.

I found another endpoint that should get me the organization name. I used this endpoint to get ID of organizations:

https://api.linkedin.com/v2/organizationalEntityAcls?q=roleAssignee&role=ADMINISTRATOR&start=0&count=100&fields=organizationalTarget&oauth2_access_token='.$oauth_token;

Then when I extract the ID from urn leaving me with just ID number I use that in this request

https://api.linkedin.com/v2/organizations/'.$company_id.'?projection=(elements*(entity~(vanityName)))&oauth2_access_token='.$oauth_token;

The problem is that this request is returning 200 status with the output being "{}".

I don't understand why no data would be returned? It seems like the API request is failing considering the first request worked successfully.

Upvotes: 1

Views: 383

Answers (2)

Steven Kuck
Steven Kuck

Reputation: 51

Reposted an answer to your original question: I found the answer on this page: https://learn.microsoft.com/en-us/linkedin/shared/references/migrations/permissions-resources-mapping

"rw_organization_admin" is the missing scope.

Upvotes: 1

Matteo
Matteo

Reputation: 39390

I can replicate the problem, you should use a different projection. Use this:

projection=(vanityName)

Instead of this:

projection=(elements*(entity~(vanityName)))

Probably the doc here seems misleading about the usage of the decorator in this case.

Hope this help

Upvotes: 2

Related Questions