如何获取V2 API的Linkedin人ID? [英] how to get Linkedin person id for V2 api?

查看:236
本文介绍了如何获取V2 API的Linkedin人ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图通过Linkedin V2 API在我的LinkedIn个人资料上发布.不断返回错误

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

请求错误:com.linkedin.publishing.util.common.ResponseException: "person"类型的作者无权修改 UserGeneratedContent ..

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

这可能是因为我没有发送我的LinkedIn个人ID.

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

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

我如何找到我的linkedin个人资料的个人ID?

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

推荐答案

您可以使用人员ID :

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

响应中返回的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)"

将返回:

{
  "id": "yrZCpj2Z12"
}

这篇关于如何获取V2 API的Linkedin人ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆