how to get Linkedin person id for V2 api?

守給你的承諾、 提交于 2020-05-16 03:04:58

问题


I am trying to post on my LinkedIn profile through Linkedin V2 API. It keeps returning an error

Request Error: com.linkedin.publishing.util.common.ResponseException: Writers of type person are not authorized to modify UserGeneratedContent..

maybe this is happening because I didn't send my LinkedIn person id.

$author = array(
            'author' => 'urn:li:person:XXXXXXXX',
        );

How can i find my linkedin profile's Person id?


回答1:


You can use the Profile API to Retrieve Current Member's Profile. In the Section about the Person ID:

The id returned in the response is the unique identifier of the user

You can also use fields projection in order to retrieve only the id field, as example:

curl -H "Authorization: Bearer <token>" \
"https://api.linkedin.com/v2/me?projection=(id)"

will return:

{
  "id": "yrZCpj2Z12"
}


来源:https://stackoverflow.com/questions/59249318/how-to-get-linkedin-person-id-for-v2-api

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