I am experiencing an issue with accessing the LinkedIn API to retrieve metrics for shares. I can successfully create posts using the ugcPosts
endpoint,
but when I try to retrieve metrics using the shares
endpoint, I receive the following error:
{
“status”: 403,
“serviceErrorCode”: 100,
“code”: “ACCESS_DENIED”,
“message”: “Not enough permissions to access: shares.GET.NO_VERSION”
}
Here are the details of my setup:
- API Endpoints:
https://api.linkedin.com/v2/ugcPosts
(POST),https://api.linkedin.com/v2/shares/{postId}
(GET) - Scopes:
openid
,profile
,w_member_social
- OAuth2 Flow: Authorization code flow
- Access Token: Successfully obtained and used for creating posts
Does anybody know the steps to resolve this issue? Are additional scopes or configurations required?
I generated my LinkedIn access token in the LinkedIn Dev portal.
Using that token,
I did a POST https://api.linkedin.com/v2/ugcPosts in postman and it worked.
I did a POST https://api.linkedin.com/v2/ugcPosts in a C# program and it worked.
Each time, I get the {postId} as a result.
But when I tried https://api.linkedin.com/v2/shares/{postId}
in postman (with the same access token) it failed.
I didn’t try https://api.linkedin.com/v2/shares/{postId}
in in my C# program (no benefit).
I repeated the same steps by generating my LinkedIn access token in my C# program.
Same results.
Jean-Philippe Borel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.