Share via

How to retrieve statistics for specific UGC Posts with organizationalEntityShareStatistics API endpoint

Vladyslav Voloshchuk 20 Reputation points
2025-11-26T11:51:09.4133333+00:00

Hello, I'm trying to get post statistics using this endpoint:
https://learn.microsoft.com/en-us/linkedin/marketing/community-management/organizations/share-statistics?view=li-lms-2025-11&tabs=curl

The problem is Docs content is incorrect. The API call results in a bad parameter error when providing ugcPosts in query parameters.

I found this ticket on github https://github.com/ebx/ebx-linkedin-sdk/issues/131 talking about this issue. Seems like ugcPost hasn't been implemented or this endpoint is outdated.

Do you mind helping me with retrieving post statistics? Maybe there's a new endpoint for this or a different parameter name that is not documented.


Moved from: Community Center | Discuss the Q&A site | Site bug or problem

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments

Answer accepted by question author

  1. Harry Phan 18,600 Reputation points Independent Advisor
    2025-11-26T23:43:38.5533333+00:00

    Hi Vladyslav Voloshchuk

    You are correct that the current documentation for the Share Statistics endpoint is misleading. The parameter ugcPosts is not supported, which is why you are seeing the bad parameter error. This endpoint is designed to work with share URNs (e.g., urn:li:share:{id}) rather than UGC post URNs.

    At present, the supported way to retrieve statistics is:

    Use the Share Statistics API with the shares parameter, passing the share URN(s).

    For UGC posts, you must first resolve the UGC post to its corresponding share URN. The API does not accept ugcPost directly.

    LinkedIn has acknowledged this gap, and the documentation is expected to be updated to clarify the distinction.

    If you need metrics specifically for UGC posts, the recommended approach is:

    Query the UGC post object to obtain its associated share URN.

    Call the Share Statistics endpoint with that URN.

    There is no new endpoint for UGC post statistics at this time; the workaround is to map UGC posts to shares before retrieving analytics.

    Harry.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Q&A Assist
    2025-11-26T11:52:22.0766667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To retrieve statistics for specific UGC Posts using the organizationalEntityShareStatistics API endpoint, you need to ensure that you are using the correct parameters as specified in the API documentation. If you are encountering a bad parameter error when providing ugcPosts in the query parameters, it may indicate that the endpoint or the parameters have changed or are not implemented as expected.

    Here are some steps you can take to troubleshoot and potentially resolve the issue:

    1. Check Permissions: Ensure that you have the necessary permissions to access the statistics for UGC Posts. You may need specific OAuth scopes to retrieve this data.
    2. Parameter Validation: Double-check the parameters you are sending in your API request. Make sure that they align with the latest documentation and that you are using the correct format for the ugcPosts parameter.
    3. API Version: Confirm that you are using the correct version of the API. Sometimes, older versions may not support certain parameters or features.
    4. Contact Support: If the documentation appears to be outdated or incorrect, consider reaching out to LinkedIn support or checking their developer forums for updates or known issues.
    5. Review GitHub Issues: Since you mentioned a GitHub ticket discussing this issue, keep an eye on that ticket for any updates from the maintainers or other developers who may have encountered the same problem.

    If there is a new endpoint or a different parameter name that is not documented, it would typically be announced in LinkedIn's developer updates or forums. Regularly checking these resources can help you stay informed about any changes.


    References:

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.