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

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

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!

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

Related

Get All Posts from Facebook Page

I am looking for the information posted on the facebook page. I am able to hit the api as below https://graph.facebook.com/v2.8/203511053776284/feed?limit=100&access_token=XXXXXXXXXXX&format=json. I am able to get the below data but no images related with post.
data": [
{
"message": "This is my first post",
"created_time": "2018-05-16T08:05:02+0000",
"id": "203511053776284_203511440442912"
}
]
Any way to get all the information from facebook page.
You need to pass fields value to fetch additional data.
https://graph.facebook.com/v2.8/203511053776284/feed?fields=id,name,message,story,created_time,link,description,caption,attachments{media,type,subattachments}&limit=100&access_token=XXXXXXXXXXX&format=json.
I recommend exploring Graph API Explorer tool.

Linkedin rest api to search people with name

Is there any LinkedIn Rest API available to search people with first and last name?
I am not able to find anything on their developer website.
I found this url from some other question: http://api.linkedin.com/v1/people-search:(people:(id))?first-name=bill&last-name=gates
But when I am trying to hit this url from APIGee REST console I am getting response as 403 permission denied. I am using oAuth with my LinkedIn account.
I am currently using free account on LinkedIn, is because of that.
Linked has closed its API some time ago. See a detailed announcement here.
You have to get Vetted API access from Linkedin in order to do People Search. For more information please look into this link
You can use LinkedIn Public Search Results Scraper API to achieve this.
Here is an example. Response for a profile found look like this:
{
"id": "jimmy-neutron-b914a91a5",
"name": "Jimmy Neutron",
"occupation": "Chief Executive Officer at NASA - National Aeronautics and Space Administration",
"location": "Houston, TX",
"last_job": "NASA - National Aeronautics and Space Administration",
"last_education": "Harvard University",
"thumbnail": "https://media-exp1.licdn.com/dms/image/C4D03AQE7YG6jwNNy2Q/profile-displayphoto-shrink_200_200/0/1584908070871?e=1620259200&v=beta&t=QJREJQLCsAIaDiQCOZJ6Nu6QoyUPWK8ytJAWU52icRU",
"link": "https://www.linkedin.com/in/jimmy-neutron-b914a91a5?trk=people-guest_people_search-card"
},
Now LinkedIn does not provide search people apis for the reason for data-stealing.
thanks

Commenting on Facebook Page Ratings (Reviews) via Graph API

Long time lurker first time poster...
We are working with Facebooks API's to integrate into our web application and we are able to pull a Companies Page Rating via the {open_graph_story} parameter in the {page-id}/ratings section, however we cannot find a way to comment/reply to the rating. The documentation states:
"If a person has rated your page and a story has been generated, you can follow up with the person by posting to the story's comment node." (https://developers.facebook.com/docs/graph-api/reference/v2.0/page/ratings)
however when we pull the variables we retrieve no ID to reference for a comment. This is what we receive back from our authenticated account:
"data": [
{ "created_time": "2014-07-16T05:52:50+0000", "reviewer": { "id": "100000237096397", "name": "Romey Salazar" }, "rating": 5, "review_text": "Great job guys!!!!" } ],
Does anyone know how to retrieve the id for the rating itself so we can append a comment via API? Or some other way to reply/comment to a FB Page Rating?
Thanks!
When you have some ratings/review comments on your page and if you want to post comment to individual review comments as the Page Owner, you can follow the steps below.
1) Below request returns the json object of rating and reviews.
https://graph.facebook.com/v2.9/{YOUR_PAGE_ID}/ratings?field=open_graph_story&access_token={YOUR_PAGE_ACCESS_TOKEN}
The response json will contain ID field for each and every rating/review comments.
2) Using the ID, trigger the below request to post a comment on the rating as the Page Owner. You will need Page access token with manage_pages and publish_pages privilege.
https://graph.facebook.com/v2.9/{ID_OF_THE_RATING}/comments?message=Thanks for your rating&access_token={YOUR_PAGE_ACCESS_TOKEN}
These requests can be tested using Facebook Graph API Explorer
You need to request the open_graph_story field with the ratings endpoint. This will return the open_graph_story data which includes an id. You can then post to the comments endpoint of this story.
You have to make http get request on
https://graph.facebook.com/v2.9/{PageID}/ratings?fields=open_graph_story&access_token={PageAccessToken}
to get detailed response.
Make sure the parameter is "fields" not "field"

Posts from Instagram not showing up on Facebook Open Graph API

I have an issue with Facebook OpenGraph API. Whenever I request data using either '/home' or '/feed', none of the posts from Instagram showed up.
I've been googling around and apparently some people raised the same issue with no solution yet. And I read some that the issue not only affecting posts from Instagram, but also other third-party app/device/platform.
Even the ticket posted on Facebook's dev page seems somewhat dead (no continuation). Link: https://developers.facebook.com/bugs/110563582419837/
If any of you guys also stumbled on this issue and has some ideas/pointers/links, please do share and let's discuss it.
Much appreciated. Cheers!
There are two bug reports in Facebook's bug tracker about this:
https://developers.facebook.com/bugs/110563582419837 and https://developers.facebook.com/bugs/202119973248747
The core reason is that the photos are attached to Open Graph actions as User Generated Photos and not via the regular Photo upload API.
As such, the regular photos permissions don't grant access to them and you need the user to specifically allow you the access their Open Graph activity for the app that posted the actions. The bug reports above are accepted on the basis that this appears to be an oversight in the case of actions with user generated photos, but it could also be by design in which case what i've outlined below as a workaround would be the only supported way to do this:
If you specifically need to request Instagram (or another Open Graph photos app) photos for a user, you can ask for Permission to access the actions posted by that app.
For Instagram photos you can do this by requesting the user_actions:instapp permission and once you've done that the Instagram Photos album will no longer appear to be empty, and the Instagram activity will appear in the feed connection.
To find out the namespace for an arbitrary app, access https://graph.facebook.com/<APP ID> and look for the namespace field,
e.g. for instagram, a call to https://graph.facebook.com/124024574287414/?fields=id,namespace returns:
{
"id": "124024574287414",
"namespace": "instapp"
}
A sample photo from my own /feed connection, retrieved with the read_stream, user_photos, user_actions:instapp permissions, is:
{
"data": [
{
"id": "[SNIPPED]",
"from": {
"name": "[SNIPPED]",
"id": "[SNIPPED]"
},
"picture": "[SNIPPED]",
"link": "https://www.facebook.com/photo.php?fbid=[SNIPPED]",
"icon": "https://fbstatic-a.akamaihd.net/rsrc.php/v2/yb/x/StEh3RhPvjk.gif",
"privacy": {
"value": ""
},
"type": "photo",
"object_id": "[SNIPPED]",
"application": {
"name": "Instagram",
"namespace": "instapp",
"id": "124024574287414"
},
"created_time": "2013-01-07T17:33:04+0000",
"updated_time": "2013-01-07T17:33:04+0000",
"comments": {
"count": 0
}
},
I can also access the /photos connection of my 'Instagram Photos' album with the same permissions, and can access all Instagram 'take' actions (i.e the photos) at /me/instapp:take
Facebook employee here. Looking at the internal task that is tracking this issue, all I can say at this time is that this is an issue that we are currently aware and investigating into. If you would like to be notified of any updates, be sure to click "subscribe" on the bug report.
For the time being, I recommend finding the album ID of the user named "Instagram Photos", then calling a GET request to /INSTAGRAM_ALBUM_ID/photos to get their Instagram photos. On the Graph API Explorer tool, I confirm that I am able to fetch all of my instagram pictures. Since my album is public, you should be able to view them as well.

Scope of Facebook API

I am trying to learn and create a Facebook API on the go. However, I haven't found any page on the developer pages that specifies the scope of the Facebook API in great detail. I understand public information can be accessed using Graph API. But at the same time understand that further access is possible, not sure how much though.
Is there anyway to access the 'Edit news feed options' of a user that authorizes an application?
I don't really understand what you mean by "scope", but the Graph API is not more than a series of URLs to contact the facebook servers with queries and obtain answers in form of JSON objects.
You can start learning by looking at the reference for the API here:
http://developers.facebook.com/docs/reference/api/
There are unofficial APIs for every language you can imagine, for example java: http://code.google.com/p/facebook-java-api/ , c#: http://facebooksdk.codeplex.com/ , etc.
To read the news feed, you can access it by:
https://graph.facebook.com/me/home?access_token=TOKEN (where TOKEN is the access token)
Fb will respond with a JSON object similar to the one pasted below.
{
"data": [
{
"id": "11111_1111111111,
"from": {
"name": "Name",
"id": "11111111"
},
"message": "SOME_MESSAGE",
"actions": [
{
"name": "Comment",
"link": "http://www.facebook.com/111111/posts/11111"
},
{
"name": "Like",
"link": "http://www.facebook.com/11111/posts/11111"
}
],
"type": "status",
"created_time": "2011-04-20T20:19:04+0000",
"updated_time": "2011-04-20T20:19:04+0000"
},
etc etc etc
],
"paging": {
"previous": "https://graph.facebook.com/me/home?access_token=TOKEN",
"next": "https://graph.facebook.com/me/home?access_token=TOKEN"
}
}
Having that, you can use the ID for the person or the message to perform new queries, as explained in the FB API page:
All of the objects in the Facebook
social graph are connected to each
other via relationships. Bret Taylor
is a fan of the Coca-Cola page, and
Bret Taylor and Arjun Banker are
friends. We call those relationships
connections in our API. You can
examine the connections between
objects using the URL structure
https://graph.facebook.com/ID/CONNECTION_TYPE.
The connections supported for people
and pages include:
Almost every information on FB is accessible through the Graph API, provided the user authorized the app with the rigth permissions:
http://developers.facebook.com/docs/authentication/permissions/