LinkedIn API: Unpermitted fields present in REQUEST BODY when trying to make post in group

♀尐吖头ヾ 提交于 2021-01-07 02:41:00

问题


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

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