0

I have linkedin Id. I need to check whether it is valid id using rest client or similar to that. I don't want to fetch data or some other stuffs for that id. I need to do this in Ruby on rails. Can anyone please guide me in detail?

Dinesh
  • 45
  • 10

1 Answers1

1

I'm not familiar with LinkedIn API, but the simplest solution would be to query the website directly and check the status code of the response.

For example, using the Faraday gem:

res = Faraday.get('http://www.linkedin.com/in/' + person_id)
if res.status == 200
  ...
end

The disadvantage of this approach is that the entire webpage is fetched every time, even if you only check the status. You can probably find a similar call to the LinkedIn API which would return less data.

Jakub K
  • 1,713
  • 1
  • 13
  • 21