问题
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