When trying to get data on shares from the LinkedIn Organization Share Statistics API
https://api.linkedin.com/rest/organizationalEntityShareStatistics?q=organizationalEntity&organizationalEntity={organization URN}&shares=List({comma-separated share URNs})
I get the following error:
{
"message": "Viewer has insufficient permissions to view statistics of organization {organization URN}",
"status": 403
}
However, UGC posts work fine:
https://api.linkedin.com/rest/organizationalEntityShareStatistics?q=organizationalEntity&organizationalEntity={organization URN}&ugcPosts=List({comma-separated UGC post URNs})
And getting stats for the whole organization (providing neither shares nor UGC posts in the API request) works as well.
Acccording to the API documentation, the permission rw_organization_admin and a member who is an administrator is required.
So, I created an access token with my account who is an admin of the organization and permissions including rw_organization_admin.
Therefore, I expected to get statistics for all kinds of posts but for some reason, only UGC posts are working but not shares.
How do I get share data? Are there specific permissions required for seeing share data as opposed to UGC post data?
I found out that I wasn’t admin of the organization after all, only of the corresponding developer app. After I had been added as a super admin to the company page itself, the 403 errors disappeared.