问题
I am trying to write a code for making posts in my LinkedIn group automatically. I am using the following API command (with my person and group):
POST
https://api.linkedin.com/v2/ugcPosts
BODY
{
"author": "urn:li:person:123ABC",
"containerEntity": "urn:li:group:123",
"lifecycleState": "PUBLISHED",
"specificContent": {
"com.linkedin.ugc.ShareContent": {
"media": [
{
"description": {
"attributes": [],
"text": "Check out our awesome group!"
},
"status": "READY",
"thumbnails": [],
"title": {
"attributes": [],
"text": "Group Post!"
}
}
],
"shareCommentary": {
"attributes": [],
"text": "Some group text"
}
}
},
"visibility": {
"com.linkedin.ugc.MemberNetworkVisibility": "CONTAINER"
}
}
But I am getting that error:
{"serviceErrorCode":100,"message":"Unpermitted fields present in REQUEST_BODY: Data Processing Exception while processing fields [/containerEntity]","status":403}
I registered an application and get the access token in scope w_member_social
.
Do I understand correctly that I lack access for using this command?
Please, help me.
回答1:
I would suggest to change
"com.linkedin.ugc.MemberNetworkVisibility": "CONTAINER"
to
"com.linkedin.ugc.MemberNetworkVisibility": "PUBLIC"
来源:https://stackoverflow.com/questions/57113333/linkedin-api-unpermitted-fields-present-in-request-body-when-trying-to-make-pos