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.