首页 > 解决方案 > 使用rest api来自linkedin的错误响应

问题描述

我正在尝试使用 rest API 方法实现登录 LinkedIn 功能。我从LinkedIn得到了access_token& 。expires_in我已经从中提取了 access_token 并传递给get请求以获取配置文件详细信息。但我没有得到任何回应。这是我的代码。

gettheLinkedinUserDetails(token: any) {

alert(token);

let headers = new HttpHeaders();

//headers.append('Content-Type', 'application/x-www-form-urlencoded');

headers.append('Authorization','Bearer '+token);

return this.http.get('https://api.linkedin.com/v1/people/~:(id,first-name,last-name,email-address,picture-url)?format=json',{headers: headers})

} 

&

this.lkPage.gettheLinkedinUserDetails(result)
            .subscribe((profileData: any) => {
              alert(profileData + 'profile');
            },(err) => {
              alert(err + 'error');
            })

& 在响应中,我得到的错误是 {"headers":{"nomalizedNames":{},"lazyUpdate":null},"status":401,"stsusText":"OK","url":"https://api.linkedin.com/v1/people/~:(id,first-name,last-name,email-address,picture-url?format=json" ","ok":false,"name":"httpErrorResponse""message":"Http failure response forhttps://api.linkedin.com/v1/people/~:(id,first-name,last-name,email-address,picture-url)?format=json;401 OK","error ":{"errorCode":0,"message":"Unknown authentication schema","requestId":"B6AFJPFBMX","status":401 "timestamp":1535978521964}}

标签: angularionic2linkedinmean-stacklinkedin-api

解决方案


推荐阅读