According to LInkedIn API docs, I was creating Image Share in 3 steps:
- I successfully registered my image to be uploaded. The response contained uploadUrl and asset id
- I successfully uploaded a picture. I made sure it had AVAILABLE status by sending request GET https://api.linkedin.com/v2/assets/C5622AQE1VHX1sCfgxA
- But when I tried to create a share with this image, I received 500 Internal Server Error response.
That was my request:
POST https://api.linkedin.com/v2/ugcPosts
{
"author": "urn:li:person:RRN_AC88I8",
"lifecycleState": "PUBLISHED",
"specificContent": {
"com.linkedin.ugc.ShareContent": {
"shareCommentary": {
"text": "test"
},
"shareMediaCategory": "IMAGE",
"media": [
{
"status": "READY",
"description": {
"text": "test"
},
"media": "urn:li:digitalmediaAsset:C5622AQE1VHX1sCfgxA",
"title": {
"text": "test"
}
}
]
}
},
"visibility": {
"com.linkedin.ugc.MemberNetworkVisibility": "PUBLIC"
}
}
I also added headers:
X-Restli-Protocol-Version: 2.0.0
Content-Type: application/json
Authorization: Bearer ****
I've been granted w_member_social permission.
It's worth noting if I create Image Share on the Company page in the same way, it works fine (I respectively change 'author', 'media' fields and access token in the header).
Also, it works fine on the personal page if I remove the 'media' field from JSON and set:
"shareMediaCategory": "NONE"
Then why doesn't it work out for creating Image Share on a personal (profile) page?
question from:
https://stackoverflow.com/questions/65713755/creating-image-share-works-fine-on-company-page-but-i-receive-500-internal-serve 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…