![](/img/trans.png)
[英]Does LinkedIn support OAuth 2.0 “Resource Owner Password Credentials” grant type?
[英]Owner entity type person is not supported Linkedin
當我嘗試使用https://api.linkedin.com/v2/shares在linkedin 中共享時,出現錯誤。
{
"message": "Owner entity type person is not supported",
"status": 400
}
我在正文中發送的數據是
{
"content": {
"title": "Test Share with Content"
},
"owner": "urn:li:person:anuroop-francis-29278068",
"subject": "Test Share Subject",
"text": {
"text": "Test Share!"
}
}
也許您正在發送分發對象,如下所示
"distribution": {
"linkedInDistributionTarget": []
}
請注意,linkedInDistributionTarget是數組,但根據doc應該是對象。
這里的問題是owner
字段。 此特定錯誤是由您在值urn:li:person:anuroop-francis-29278068
使用的錯誤配置文件 ID anuroop-francis-29278068
urn:li:person:anuroop-francis-29278068
。 看起來您從個人資料鏈接https://www.linkedin.com/in/anuroop-francis-29278068/
獲取 id 。
您需要做的就是將正確的個人資料 ID 放入owner
字段值中。 獲取正確的個人資料 ID 的最簡單方法之一是從docs 訪問GET
https://api.linkedin.com/v2/me
端點。 在響應中,您可以找到一個包含您需要的個人資料 ID 的字段:
{
...
"id":"yrZCpj2Z12",
...
}
然后只需將此值放在您的owner
字段中:
{
...
"owner": "urn:li:person:yrZCpj2Z12",
...
}
現在,當您點擊https://api.linkedin.com/v2/shares
端點時,您將在給定的用戶個人資料上有一個共享帖子。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.