Post an article to company LinkedIN page via REST api (v2)

梦想与她 提交于 2020-01-14 02:19:24

问题


Using v2 of LinkedIn REST API I'm searching for a way to post an article to my company's LinkedIn page.

I've signed up here https://business.linkedin.com/marketing-solutions/marketing-partners/become-a-partner/marketing-developer-program and currently waiting to be approved.

I want to be able to create a blog post on my company website and when i press 'publish' i want to post that blog post, as an article, to my companys LinkedIn page.

The closest i've been to finding information regarding this topic is https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/articles-api But this does not disclose any information for posting articles, only retrieving and deleting them


回答1:


You can share articles to your LinkedIn company feed using content entities (contentlocation and thumbnail). You can also provide a title and description for the article you want to share.

An example of a share with article is as follows:

{
    "owner": "urn:li:organization:12345",
    "content": {
        "contentEntities": [{
            "entityLocation": "https://www.example.com/content.html",
            "thumbnails": [{
                "resolvedUrl": "https://www.example.com/image.jpg"
            }]
        }],
        "description": "content description",
        "title": "Test Company Share with Content"
    },

    "text": {
        "text": "This is a share with an article"
    }
}

Documentation for this API endpoint can be found here:

https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/share-api#share-content.

Hope it helps!




回答2:


With the new UGCPost APIs, you should use the Create UGC Posts method (Documentation).

To use the method, after authentication, you will use:

POST https://api.linkedin.com/v2/ugcPosts

with the author as your organization, such as "urn:li:organization:5590506". Also, to do so, you will need the w_organization_social permission with one of the following roles:

  • ADMINISTRATOR
  • DIRECT_SPONSORED_CONTENT_POSTER
  • RECRUITING_POSTER


来源:https://stackoverflow.com/questions/54831436/post-an-article-to-company-linkedin-page-via-rest-api-v2

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