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

2

8

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

Necrotomy answered 22/2, 2019 at 16:35 Comment(0)
I
10

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!

Impoverish answered 25/2, 2019 at 8:49 Comment(9)
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)Necrotomy
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.Impoverish
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.Necrotomy
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!Impoverish
LinkedIn states that the ShareV2 APIs will be "deprecated soon" here: learn.microsoft.com/en-us/linkedin/marketing/integrations/… 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?Bonne
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!Impoverish
@DavidBackeus Did you see this link? It explains how to create a share on behalf of an organization.Impoverish
How to get access token?Peruke
can I programmatically post the article on my LinkedIn page similar to how I manually did here at linkedin.com/pulse/…Besetting
C
5

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
Countrified answered 23/10, 2019 at 20:10 Comment(1)
can I programmatically post the article on my LinkedIn page similar to how I manually did here at linkedin.com/pulse/…Besetting

© 2022 - 2024 — McMap. All rights reserved.