gpt4 book ai didi

linkedin - 无法通过 API 发布到 LinkedIn 群组

转载 作者:行者123 更新时间:2023-12-03 20:49:50 33 4
gpt4 key购买 nike

按照此处的“创建群组帖子”示例通过 LinkedIn API 发布到群组时:
https://docs.microsoft.com/en-us/linkedin/compliance/integrations/groups/group-posts-and-actions?context=linkedin/compliance/context
我总是收到:
“REQUEST_BODY 中存在不允许的字段:处理字段 [/containerEntity] 时出现数据处理异常”
我们的应用程序是营销开发者平台合作伙伴。我在授权时获得了 w_organization_social、w_member_social、rw_organization_admin、r_liteprofile、r_emailaddress 权限。
我可以成功发布到组织页面。
我该如何解决这个错误?我们需要请求额外的权限吗?
索取详情:

REQUEST: https://api.linkedin.com/v2/ugcPosts
METHOD: HttpMethod(value=POST)
COMMON HEADERS
-> X-Restli-Protocol-Version: 2.0.0
-> Authorization: Bearer <...>
-> Accept: application/json
-> Accept-Charset: UTF-8
BODY Content-Type: application/json

Request body:
{
"author": "url:li:person:<id>",
"containerEntity": "urn:li:group:<id>",
"specificContent": {
"com.linkedin.ugc.ShareContent": {
"media": [
{
"description": {
"text": "Check out our awesome group!",
"attributes": []
},
"status": "READY",
"thumbnails": [],
"title": {
"text": "Group Post!",
"attributes": []
}
}
],
"shareCommentary": {
"text": "Some group text",
"attributes": []
}
}
},
"visibility": {
"com.linkedin.ugc.MemberNetworkVisibility": "CONTAINER"
},
"lifecycleState": "PUBLISHED"
}

最佳答案

我正在查看您链接中的示例代码:

{
"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"
}
}
我注意到在示例代码中,它是 media:[ ]
但是在你的代码中你没有使用 []
这可能就是您收到此错误消息的原因。

关于linkedin - 无法通过 API 发布到 LinkedIn 群组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63485165/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com