Receiving and creating sub comments LinkedIn company page - linkedin

I'm trying to receive and create sub comments (on behalf of my company page) on LinkedIn using the REST API. I've created an example post:
Example post
When calling https://api.linkedin.com/v1/companies/900153/updates/?start=0&count=100, I receive the post itself ("Level 1 post") and my comment ("Level 2, comment"). The LinkedIn website allows me to create a sub comment under "Level 2, comment", which I did.
Now I don't seem to be able to receive this "Level 3, sub comment". I've tried using /v1/companies/900153/updates/key=UPDATE-c900153-6282480798125948928/update-comments/?format=json, but this will only return my level 2 comment. At the same time, I can't find a way to create a sub comment using the REST API, like I did on the website itself.
Am I missing something?

Related

LinkedIn Share API Response is returning an updateUrl which when visited goes to a page not found

I have an application which is successfully sharing to LinkedIn as per the official documentation here:
https://developer.linkedin.com/docs/share-on-linkedin
When I get a 201 created response the content is being shared to LinkedIn which is great...but in the response under the updateUrl property the URL I always get is bringing back a page not found URL, for example:
https://www.linkedin.com/company/3728030/comments?topic=6368780249068507136&type=U&scope=3728030&stype=C&a=_YH0
When I visit the actual post on LinkedIn and get the post URL it gets this: https://www.linkedin.com/feed/update/urn:li:activity:6368780249068507136
and this URL actually works. In the documentation it says:
The updateURL value is a direct link to the newly shared content on LinkedIn.com that you can direct the user's web browser to.
I have tried this on multiple LinkedIn accounts and I am getting the same issue. I could parse my updateUrl property and transform it into a working URL but as per the documentation I shouldn't have to do this and it seems like a bug...
The same thing applies to newly created company shares: https://developer.linkedin.com/docs/company-pages#company_share
The returned value is e.g.
{
"updateKey": "UPDATE-c111111-11111111",
"updateUrl": "https://www.linkedin.com/company/111111/comments?topic=11111111&type=U&scope=18464510&stype=C&a=ls_e"
}
That URL directs you to a non-existing page. For proper use, the "updateKey" needs to be parsed and the link manually created e.g. "https://www.linkedin.com/feed/update/urn:li:activity:11111111"
Note, the URLs and keys are changed.
I'm also wondering the purpose of the "updateUrl", since its undocumented on company shares, and seemingly misleading on shares documentation.
Thanks :)

Rfacebook Packages getpage() command only retrieving a few posts from Facebook Pages

I recently tried Rfacebook package by pablobarbera, which works quite well. I am having this slight issue, for which I am sharing the code.
install.packages("Rfacebook") # from CRAN
library(devtools)
install_github("Rfacebook", "pablobarbera", subdir = "Rfacebook")
library(Rfacebook)
# token generated here: https://developers.facebook.com/tools/explorer
token <- "**********"
page <- getPage("DarazOnlineShopping", token, n = 1000)
getPage command works, but it only retrieves 14 records from the Facebook page I used in the command. In the example used by pablobarbera in the original post he retreived all the posts from "Humans of New York", but when I tried the same command, facebook asked me to reduce the number of posts, and I hardly managed to get 20 posts. This is the command used by Pablo bera:
page <- getPage("humansofnewyork", token, n = 5000)
I thought I was using temporary token access that why Facebook is not giving me the required data, but I completed the wholo Facebook Oauth Process, and the same result.
Can somebody look into this, and tell why this is happening.
The getPage() command looks fine to me, I manually counted 14 posts (including photos) on the main page. It could be that Daraz Online Shopping has multiple pages and that the page name you are using only returns results from the main page, when (I assume) you want results from all of them.
getPage() also accepts page IDs. You might want to collect a list of IDs associated with Daraz Online Shopping, loop through and call each of them and combine the outputs to get the results you need.
To find this out these IDs you could write a scraper (or manually search for them all) that views the page source and searches for the unique page ID. Searching for content="fb://page/?id= will highlight the location of the page ID in the source code.

How to get a LinkedIn Group Post "content" through API, not just the title

When starting a Group Discussion through the LinkedIn website you can enter a postTitle and (optional) postText
However when querying this post through the LinkedIn API only the "title" is returned.
https://api.linkedin.com/v1/posts/{post-id}
Tested from https://apigee.com/console/linkedin to confirm it wasn't just my script with issues.
Is there an extra parameter I can pass to the API to get this "text" field on a Group Discussion post?
Thanks
You need to use the field selectors to specify the particular fields that you want returned from your call.
For example:
https://api.linkedin.com/v1/groups/12345:(id,name,site-group-url,posts:(id,summary,creator))
Please also note that as of May 12th, 2015, the API endpoint for Groups will no longer be publicly available. See the following blog post for more details: https://developer.linkedin.com/blog/posts/2015/developer-program-changes

Linkedin - Get companies updates queries

I'm trying to create an app to read company updates, but I have a few queries. Please help...
I'm using LinkedIn api via Oauth authentication in R
Is there anyway to fetch more updates than the restriction (only allow fetch up to 250 updates or updates in the last 20 days whichever comes first) ?
Example code
https://api.linkedin.com/v1/companies/270126/updates?event-type=status-update&count=100&start=0 &oauth2_access_token={access_token}
Once I got the updateKey, I'm trying to fetch the comments and likes but it's returning NO return
Example code
https://api.linkedin.com/v1/companies/270126/updates/key=UPDATE-c270126-5951438751136768000/update-comments?event-type=status-update&oauth2_access_token={access_token}
https://api.linkedin.com/v1/companies/270126/updates/key=UPDATE-c270126-5951438751136768000/likes?event-type=status-update&oauth2_access_token={access_token}
From the company status-update, it's returning FALSE for is-commentable and is-likable? Is that why there are no result from Query 2. If so, is there anyway to change that setting?
'is-commentable' false '/is-commentable'
'is-likable' false '/is-likable'
Any help would be greatly appreciated!!!!
Linkedin developer - Reading Company Shares link
https://developer.linkedin.com/reading-company-shares
Try using the Share and Social Stream end point instead of the Companies end point like this:
https://api.linkedin.com/v1/people/~/network/updates/key=UPDATE-c270126-5951438751136768000/update-comments?oauth2_access_token={access_token}
The documentation is here:
https://developer.linkedin.com/documents/commenting-reading-comments-and-likes-network-updates
Also you can test different Linkedin API calls here:
https://apigee.com/console/linkedin

On Phabricator get the comment from a feed story

I'm using Phabricator's feed.http-hooks feature to post messages in a dev chat room whenever relevant events happen in the news feed. This works great for showing that "Alice created diff D12345" or "Bob updated diff D54321."
When someone comments on a diff, I want to extract the comment text from the story. Whenever there's a comment, Phabricator sends HTTP POSTs to my feed.http-hooks server containing parameters like the following:
storyID=42
storyType=PhabricatorApplicationTransactionFeedStory
storyData[objectPHID]=PHID-DREV-blahblah1
storyData[transactionPHIDs][0]=PHID-DREV-blahblah2
storyAuthorPHID=PHID-USER-blahblah3
storyText=tom added a comment to D12345: Some random diff.
epoch=1412243745
My question is, how can I get the actual text of the comment? I've tried using Conduit's phid.query method to look up some of these PHIDs, but that hasn't gotten me anywhere. I know this is possible because the comment shows up in the actual "Recent Activity" feed on the Phabricator site. Halp.

Resources