I have implemented login with LinkedIn and I am getting access token
after successful login by session.getAccessToken().toString()
. Now I need complete user profile and his connection list in account. But I am unable to retrieve that information from LinkedIn.
I am calling its REST client API call that was stated in official document like this
https://api.linkedin.com/v1/people/~
In this I am passing my access token as oauth2_access_token
that I got after login. But in response i am getting
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<error>
<status>401</status>
<timestamp>1440998578838</timestamp>
<request-id>P6GDCHJ13P</request-id>
<error-code>0</error-code>
<message>Unable to verify access token</message>
</error>
I have already tried various solutions like stated here:
LinkedIn OAuth2: "Unable to verify access token"
https://github.com/lepture/flask-oauthlib/issues/35
How to Retrieve all possible information about a LinkedIn Account ? (API using C#)
Using the API for LinkedIn, you can get detailed information about LinkedIn groups based on the ID of the target groups. Below are some of the data you can get: ID, name, date of creation, logo, description, location, industries, etc. Learn more in the LinkedIn API documentation.
As per official documentation it's stated that to make LinkedIn REST API
calls you need to call by APIHelper.getRequest()
method or APIHelper.postRequest()
for GET
and POST
call respectively; and fetch all requested data of the user you need to make REST URL that are already given in their documentation.
Here's the quick example to fetch user basic_profile
data:
String url = "https://api.linkedin.com/v1/people/~:(id,first-name,last-name)";
APIHelper apiHelper = APIHelper.getInstance(getApplicationContext());
apiHelper.getRequest(this, url, new ApiListener() {
@Override
public void onApiSuccess(ApiResponse apiResponse) {
// Success!
Log.d("linkedin response for data", apiResponse.getResponseDataAsJson().toString());
}
@Override
public void onApiError(LIApiError liApiError) {
// Error making GET request!
}
});
You can refer official documentation over here for complete detail
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With