Search code examples
linkedin-api

What LinkedIn API permission am I missing to get organization target name?


Using LinkedIn API v2.0 I'm currently trying to get a list of organisation ids and names for authenticated user that they are administrator of. I'm able to get all organisation ids using:

https://api.linkedin.com/v2/organizationalEntityAcls?q=roleAssignee&role=ADMINISTRATOR&start=0&count=100&fields=organizationalTarget&oauth2_access_token={{OAUTH_ACCESS_TOKEN}}

but when I add "organizationTarget~" as apart of fields parameter I get an error saying

"not enough permissions to access field organizationalTarget~ for GET-roleAssignee /organizationalEntityAcls"

Should I be using a different endpoint to get this data or what permission am I missing? I currently am using r_basicprofile, rw_company_admin, and rw_organization scopes while authenticating.


Solution

  • You can try with this API call:

     curl -i -X GET \
       -H "Authorization:Bearer <ACCESS-TOKEN>" \
     'https://api.linkedin.com/v2/organizationalEntityAcls?q=roleAssignee&role=ADMINISTRATOR&projection=(elements*(organizationalTarget~(localizedName)))'
    

    Hope this help