linkedInDistributionTarget 是必需的,即使它是空的

linkedInDistributionTarget is required even though it is empty

在post共享时,linkedInDistributionTarget 是必填字段,需要包含在post 请求的正文中。即使它是空的为什么我们需要包含在正文中。

如果我不使用那个键,会抛出以下错误

{
    "owner": "urn:li:organization:xxxxxx",
    "text": {
        "text": "Hii Kaushik from builder"
    }
}

错误:

{
    "message": "com.linkedin.restli.client.RestLiResponseException: Response status 400, serviceErrorMessage: com.linkedin.publishing.util.common.ResponseException: Company owned UGCs can only have PUBLIC or LOGGED_IN MemberNetworkVisibility.",
    "status": 400
}

来自他们的文档:

"Omitting distribution.linkedInDistributionTarget during share creation creates a dark or hidden share which is not shown publicly on LinkedIn.com. Specify the field as an empty object to make the share publicly viewable."

来源:

https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/share-api?context=linkedin/compliance/context#post-shares