0

我正在使用linkedin-j-android.jar 进行linkedinIn 连接并成功完成了我的要求。但是对于某些用户,当我尝试获取用户更新时,我遇到了异常。

com.google.code.linkedinapi.client.LinkedInApiClientException: java.lang.IllegalArgumentException: MOBILE

或者

com.google.code.linkedinapi.client.LinkedInApiClientException: java.lang.IllegalArgumentException: SKYPE

下面是堆栈跟踪:

com.google.code.linkedinapi.client.LinkedInApiClientException: java.lang.IllegalArgumentException: MOBILE
10-18 11:35:23.166: W/System.err(5813):     at com.google.code.linkedinapi.client.impl.LinkedInApiXppClient.unmarshallObject(LinkedInApiXppClient.java:119)
10-18 11:35:23.166: W/System.err(5813):     at com.google.code.linkedinapi.client.impl.BaseLinkedInApiClient.readResponse(BaseLinkedInApiClient.java:1905)
10-18 11:35:23.166: W/System.err(5813):     at com.google.code.linkedinapi.client.impl.BaseLinkedInApiClient.getUserUpdates(BaseLinkedInApiClient.java:920)
10-18 11:35:23.166: W/System.err(5813):     at com.tekriti.ice.util.LinkedinUtil.getUserUpdate(LinkedinUtil.java:205)
10-18 11:35:23.166: W/System.err(5813):     at com.tekriti.ice.util.SocialUtil.getAllSocialData(SocialUtil.java:534)
10-18 11:35:23.166: W/System.err(5813):     at com.tekriti.ice.util.SocialUtil$UpdateData.doInBackground(SocialUtil.java:648)
10-18 11:35:23.174: W/System.err(5813):     at com.tekriti.ice.util.SocialUtil$UpdateData.doInBackground(SocialUtil.java:1)
10-18 11:35:23.174: W/System.err(5813):     at android.os.AsyncTask$2.call(AsyncTask.java:264)
10-18 11:35:23.174: W/System.err(5813):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
10-18 11:35:23.174: W/System.err(5813):     at java.util.concurrent.FutureTask.run(FutureTask.java:137)
10-18 11:35:23.174: W/System.err(5813):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
10-18 11:35:23.174: W/System.err(5813):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
10-18 11:35:23.174: W/System.err(5813):     at java.lang.Thread.run(Thread.java:856)
10-18 11:35:23.174: W/System.err(5813): Caused by: java.lang.IllegalArgumentException: MOBILE
10-18 11:35:23.174: W/System.err(5813):     at com.google.code.linkedinapi.schema.PhoneType.fromValue(PhoneType.java:58)
10-18 11:35:23.174: W/System.err(5813):     at com.google.code.linkedinapi.schema.xpp.PhoneNumberImpl.init(PhoneNumberImpl.java:64)
10-18 11:35:23.174: W/System.err(5813):     at com.google.code.linkedinapi.schema.xpp.PhoneNumbersImpl.init(PhoneNumbersImpl.java:66)
10-18 11:35:23.174: W/System.err(5813):     at com.google.code.linkedinapi.schema.xpp.PersonImpl.init(PersonImpl.java:595)
10-18 11:35:23.174: W/System.err(5813):     at com.google.code.linkedinapi.schema.xpp.UpdateContentImpl.init(UpdateContentImpl.java:128)
10-18 11:35:23.174: W/System.err(5813):     at com.google.code.linkedinapi.schema.xpp.UpdateImpl.init(UpdateImpl.java:155)
10-18 11:35:23.174: W/System.err(5813):     at com.google.code.linkedinapi.schema.xpp.UpdatesImpl.init(UpdatesImpl.java:89)
10-18 11:35:23.174: W/System.err(5813):     at com.google.code.linkedinapi.schema.xpp.NetworkImpl.init(NetworkImpl.java:71)
10-18 11:35:23.174: W/System.err(5813):     at com.google.code.linkedinapi.client.impl.LinkedInApiXppClient.unmarshallObject(LinkedInApiXppClient.java:115)
4

1 回答 1

0

在 LinkedIn 上创建新的 API 密钥后,错误得到解决。新 API 创建遵循使用用户数据的范围。有关更多详细信息,请参见下面的链接 http://developer.linkedin.com/documents/authentication

因此,您需要在身份验证请求中添加范围参数,例如

https://api.linkedin.com/uas/oauth/requestToken?scope=r_basicprofile+r_emailaddress

于 2013-01-17T06:04:19.030 回答