LinkedIn: How do I retrieve statistics for specific shares using the organizationalEntityShareStatistics endpoint?

喜夏-厌秋 提交于 2019-12-11 17:53:27

问题


LinkedIn's API V2 docs specifically addresses this scenario on their Organization Share Statistics page, but I keep getting an error when trying a request based on their sample.

LinkedIn's sample request:

GET https://api.linkedin.com/v2/organizationalEntityShareStatistics
        ?q=organizationalEntity
        &organizationalEntity=urn:li:organization:2414183
        &shares[0]=urn:li:share:1000000
        &shares[1]=urn:li:share:1000001

My request (from a REST client):

GET https://api.linkedin.com/v2/organizationalEntityShareStatistics
        ?q=organizationalEntity
        &organizationalEntity=urn%3Ali%3Aorganization%3A(my org id)
        &shares[0]=urn%3Ali%3Ashare%3A(my share id)

The response:

{
    "serviceErrorCode": 100,
    "message": "Unpermitted fields present in PARAMETER: Data Processing Exception while processing fields [/shares[0]]",
    "status": 403
}

I have also tried URL-encoding the square brackets (same error) and dropping the [0] from the param (error "Invalid value type for parameter shares"). Does anyone know the proper way to format this request?


回答1:


Got it: the proper format is

GET https://api.linkedin.com/v2/organizationalEntityShareStatistics
        ?q=organizationalEntity
        &organizationalEntity=urn%3Ali%3Aorganization%3A(my org id)
        &shares=List(urn%3Ali%3Ashare%3A(my share id))


来源:https://stackoverflow.com/questions/55847112/linkedin-how-do-i-retrieve-statistics-for-specific-shares-using-the-organizatio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!