"Viewer don't have permission to the ADMIN_ONLY VisibilityReduction" when retrieving company details
Asked Answered
H

1

5

We have had code integrated with the LinkedIn API running successfully for years, and most of our tens of thousands of users have no problems with our integration, which involves connecting LinkedIn profiles and pages and sharing content to them.

As you'd expect, when the user goes through the OAuth process, we retrieve the list of companies connected to their account. Then we iterate over these companies to retrieve details by making a request to https://api.linkedin.com/v2/organizations/[id]?projection=(id,vanityName,localizedName,logoV2(cropped~:playableStreams) using the user's access token.

We now have two instances of an error occurring with the above request:

Viewer don't have permission to the ADMIN_ONLY VisibilityReduction for urn:li:organization:xxxx

It doesn't matter which fields we do or don't request. The API says these users have the ADMINISTRATOR role on said pages.

Any insight into the source of this problem would be greatly appreciated.

Heptachord answered 16/1, 2021 at 4:9 Comment(0)
C
1

You are using wrong API endpoint.

Try below endpoint:

https://api.linkedin.com/v2/organizationsLookup?ids[0]=1000&projection=(results*(localizedName,id,name))

Carse answered 3/5, 2021 at 13:39 Comment(1)
Thanks for this. For others looking here, the correct endpoint format is "api.linkedin.com/v2/organizationsLookup?ids=List(1000) [ . . . ]". I don't agree that the v2/organizations endpoint is the "wrong" endpoint when the docs say that it can be used for this purpose, and the failure is intermittent. Fun fact about this endpoint: asset decorators produce results only about half the time.Heptachord

© 2022 - 2024 — McMap. All rights reserved.