android - How to get user data after Login with LinkedIn -
i have implemented login linkedin , getting access token after successful login session.getaccesstoken().tostring(). need complete user profile , connection list in account. unable retrieve information linkedin.
i calling rest client api call stated in official document this
https://api.linkedin.com/v1/people/~
in passing access token oauth2_access_token got after login. in response 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 verify access token</message> </error> i have tried various solutions stated here:
linkedin oauth2: "unable verify access token"
https://github.com/lepture/flask-oauthlib/issues/35
how retrieve possible information linkedin account ? (api using c#)
as per official documentation it's stated make linkedin rest api calls need call apihelper.getrequest() method or apihelper.postrequest() get , post call respectively; , fetch requested data of user need make rest url given in documentation. here's quick example 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 data", apiresponse.getresponsedataasjson().tostring()); } @override public void onapierror(liapierror liapierror) { // error making request! } }); you can refer official documentation on here complete detail
Comments
Post a Comment