7

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://learn.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

rostgaard
  • 325
  • 1
  • 6
  • 19

2 Answers2

9

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://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/share-api#share-content.

Hope it helps!

  • Okay, so I won't be able to create an article containing markup, I would only be able to create a link (share) to the content on my personal website? (Just to see if i understand it correctly) – rostgaard Feb 25 '19 at 12:25
  • The text, title and description parameters you have to fill in yourself (if that is what you mean). The entityLocation is the URL to your blog, and the thumbnail URL is a link to an image on your blog page. I don't think it's possible you can add any markup (like HTML) to it tough. It is possible to work with emojis in the text parameter. – Peter van Mourik Feb 25 '19 at 12:36
  • Alright, thank you, Peter. I was talking about adding HTML to the text so that I would essentially create an article on LinkedIn as well, instead of linking people off of LinkedIn. – rostgaard Feb 25 '19 at 13:59
  • Your welcome @rostgaard. Don't worry about the markup, LinkedIn will make a great looking article post for you. Just use the available API properties and it will be fine! – Peter van Mourik Feb 25 '19 at 20:20
  • LinkedIn states that the ShareV2 APIs will be "deprecated soon" here: https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/company-pages-migration#how-to-post-shares-using-v2-apis They suggest using the UGCPost APIs instead. However they don't explain how to use it on behalf of an organization (or "company"). Any ideas? – David Backeus Jun 26 '19 at 14:44
  • Thanks, I wasn't aware of that. Strange because the other API isn't even that old. I have been working on UGC posts to upload video content, but I didn't finished it yet because I didn't have the right permissions at that time. I will dig into it and come back here if I have a solution! – Peter van Mourik Jun 27 '19 at 11:44
  • @DavidBackeus Did you see this [link](https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/ugc-post-api)? It explains how to create a share on behalf of an organization. – Peter van Mourik Jul 01 '19 at 07:16
  • How to get access token? – jjxtra Jan 23 '23 at 14:49
4

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
filipebarretto
  • 1,842
  • 1
  • 13
  • 27