Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting a profile using id doesn't appear to work... #59

Closed
angelacode opened this issue Jul 2, 2011 · 7 comments
Closed

getting a profile using id doesn't appear to work... #59

angelacode opened this issue Jul 2, 2011 · 7 comments

Comments

@angelacode
Copy link

I use the following:

client.profile(:id => linkedin_uid)

I get this error:

LinkedIn::NotFound: (404): Not Found
@angelacode
Copy link
Author

Any thoughts on why Ii would be getting a 404 error when looking up based on another ID?

@ryanatwork
Copy link
Collaborator

This works for me, maybe the latest version of the gem fixes the issue?

You can only display the profile from an ID for people in your LinkedIn Network

@john
Copy link
Contributor

john commented Nov 6, 2011

This fails for me too, using the latest version of the gem. I can't get my own profile when authed as myself, so it doesn't appear to be a network issue. I can get profiles fine by :url.

Here's the top of the stack trace in the console:

ruby-1.9.3-rc1 :011 > pro = client.profile( :id => "r3TugUrYus" )
LinkedIn::Errors::NotFoundError: (404): Not Found
from /Users/john/.rvm/gems/ruby-1.9.3-rc1@rails31/bundler/gems/linkedin-2e35630343ae/lib/linked_in/helpers/request.rb:51:in raise_errors' from /Users/john/.rvm/gems/ruby-1.9.3-rc1@rails31/bundler/gems/linkedin-2e35630343ae/lib/linked_in/helpers/request.rb:16:inget'
from /Users/john/.rvm/gems/ruby-1.9.3-rc1@rails31/bundler/gems/linkedin-2e35630343ae/lib/linked_in/api/query_methods.rb:37:in simple_query' from /Users/john/.rvm/gems/ruby-1.9.3-rc1@rails31/bundler/gems/linkedin-2e35630343ae/lib/linked_in/api/query_methods.rb:8:inprofile'
from (irb):11
from /Users/john/.rvm/gems/ruby-1.9.3-rc1@rails31/gems/railties-3.1.1/lib/rails/commands/console.rb:45:in `start'

@ryanatwork
Copy link
Collaborator

I can't replicate this issue - make sure you are using the correct LinkedIn profile id. If I use that ID In the example above I get a 404 also, that may not be the correct LinkedIn ID. The ID is not part of the default profile fields, however you can get it if you add it to the default profile fields.

[11] pry(main)> client.profile(:id=>"lkUnrbyLgY")
=> {"first_name"=>"Ryan",
"headline"=>"Fellow at Code for America",
"last_name"=>"Resella",

@john
Copy link
Contributor

john commented Nov 6, 2011

Thanks much for responding. You're right--I was using the 'uid' value I get back from omniauth, which I presumed to be the member id. But when I use your gem to get my own info via public URL ( client.profile(:url => "http://www.linkedin.com/in/jmcgrath") ), I get back a different id value, which does work.

Bit off topic and unrelated to my (non) issue, but if anyone knows how to get the Linkedin member id from an omniauth Linkedin uid, I'd be very, very grateful.

@ryanatwork
Copy link
Collaborator

I'm actually using the uid in this rails app, even though I wrote it to implement the LinkedIn ID maybe it will help -

https://github.com/codeforamerica/FellowsExchange/blob/master/app/models/user.rb

@john
Copy link
Contributor

john commented Nov 9, 2011

Thanks, that was helpful.

@hexgnu hexgnu closed this as completed Apr 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants