简体   繁体   中英

Linkedin API Company Updates not returning 50 recents updates

I am trying to fetch companies updates with this API https://developer.linkedin.com/docs/company-pages#company_updates

I use Node.js with linkedin-js package module wrapper. I found that I only got 5 posts from this company (id=3487133). But it shown in page, that it got more than 5 updates. How can I get all its posts updates ? Thanks.

Here is my code

var linkedin_client = require('linkedin-js')(appid, appsecret, url_callback)


var cid = 3487133;
var param = {
  token: {
    oauth_token_secret: <token_secret>,
    oauth_token: <token>
  },
  count: 50
}

//post
linkedin_client.apiCall('GET', '/companies/' + cid + '/updates', param, function(error, result) {
  console.log(result)
});

There is nothing wrong with your code.

From https://developer.linkedin.com/docs/company-pages#company_updates you can find that

Only the most recent 50 updates for events of type status-update will be returned. For all other event types, the request will return all the updates within the past 20 days, or 250 total updates - whichever comes first.

Using Linkedin console ( https://api.linkedin.com/v1/companies/3487133/updates ) fo getting the updates for your company, its giving the same 5 posts. Rest of the posts in your page are 20 days + older.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM