简体   繁体   English

使用字段选择器时,LinkedIn API 401未经授权

[英]LinkedIn API 401 Unauthorised when using Field Selectors

I am attempting to get specific information from the user's profile via the LinkedIn API. 我正在尝试通过LinkedIn API从用户的个人资料中获取特定信息。

The URL I am using for the GET call is the following: 我用于GET调用的URL是以下内容:

http://api.linkedin.com/v1/people/~:(id,first-name,last-name,industry,headline,public-profile-url ) http://api.linkedin.com/v1/people/~:(id,名字,姓氏,行业,标题,public-profile-url

When attempting this I get a "401 Unauthorized" response from the server. 尝试执行此操作时,我从服务器收到“ 401未经授权”响应。 However, when I do a GET to http://api.linkedin.com/v1/people/~ within the same function with the same auth keys, etc. it works just fine. 但是,当我使用相同的身份验证密钥等功能在同一函数中对http://api.linkedin.com/v1/people/~进行GET操作时,它就可以正常工作。

The error presented in the response is as follows: 响应中显示的错误如下:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<error>
  <status>401</status>
  <timestamp>1316082986700</timestamp>
  <request-id>SVWTG5ARQM</request-id>
  <error-code>0</error-code>
  <message>[unauthorized].</message>
</error>

Any ideas of why this might be happening? 为什么会发生这种情况的任何想法? Anything would be greatly appreciated. 任何事情将不胜感激。

It is likely your OAuth library is buggy. 您的OAuth库可能有错误。 Can you view the full request and response? 您可以查看完整的请求和回复吗?

I would make sure your Authorization / OAuth header has the same signature as the one generated from this tool: 我将确保您的Authorization / OAuth标头具有与此工具生成的签名相同的签名:

https://developer.linkedin.com/oauth-test-console https://developer.linkedin.com/oauth-test-console

If not, you'll need to get a new library, update/fix your library, etc. 如果没有,则需要获取新的库,更新/修复库等。

If yes, then that is weird. 如果是的话,那很奇怪。 Come back and we'll go from there :) 回来,我们将从那里走:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM