Get user profile using Oauth 2.0 from LinkedIn API
Asked Answered
G

2

6

I want to implement "sign up using LinkedIn" functionality ,I followed this document and stuck at point b with this error instead of getting access token. https://developer.linkedin.com/documents/authentication

{
    "error": "invalid_request",
    "error_description": "missing required parameters, includes an invalid parameter value, parameter more then once. : client_id"
}

I want to fill user basic information in registration form e.g. firstname,lastname,email etc. I dont want to use javascript API,and need to go with REST API of linkedIn ,

Gomar answered 10/7, 2013 at 13:6 Comment(7)
Could you share what your request looks like? What are the parameters that you pass?Sciolism
to fetch user login prompt of linked in;this will give me code value that will be used to get access token : linkedin.com/uas/oauth2/…Gomar
to get accesss token i used: linkedin.com/uas/oauth2/…Gomar
No, i was talking about your HTTP request that you sent. It is possible that you might have constructed your http request incorrectly which is causing this error.Sciolism
not getting you by HTTP request,I had only sent these two requests, 1st request is simple redirect and second one i executed with postman client for testing service using chromeGomar
i was wondering why it is showing error like this,i was able to fetch access token day before {"expires_in":5184000,"access_token":"my_generate_daccess_token"}Gomar
these are the API endpoints... you would have sent a request like this - flickr.com/services/oauth/request_token ?oauth_nonce=89601180 &oauth_timestamp=1305583298 &oauth_consumer_key=653e7a6ecc1d528c516cc8f92cf98611 &oauth_signature_method=HMAC-SHA1 &oauth_version=1.0 &oauth_callback=http%3A%2F%2Fwww.example.comSciolism
H
11

This return a json file with the user info: https://api.linkedin.com/v1/people/~?oauth2_access_token=value&format=json

For a specify value: https://api.linkedin.com/v1/people/~:(firstName,lastName,picture-url)?oauth2_access_token=value&format=json

Huckaby answered 11/8, 2015 at 18:35 Comment(2)
Nice tip. I would just add an example of json result for the full user info call with sample chars: {"firstName":"Antonio","headline":"CEO at MyCompany srls","id":"BLaaaO5111","lastName":"Smith","siteStandardProfileRequest":{"url":"linkedin.com/profile/…a1111853*s4411103"}}Tartrazine
I took 2 days to find this answer! It's unbelievable that LinkedIn does not provide this information in their API documentation.Mandalay
O
3

Please refer the following,

http://www.bigcode.net/2013/08/linkedin-share-api-usage-using-oauth2.html

It has the details on using OAuth2 and accessing one of the api.

The code may be used for authentication. Once you are authenticated, you can use the Profile api mentioned here

http://developer.linkedin.com/documents/profile-api to get the profile details.

Octastyle answered 2/8, 2013 at 1:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.