无法使用“获取/活动”获取用户个人资料上的信息

时间:2020-02-03 11:07:01

标签: ruby-on-rails oauth linkedin linkedin-api

遇到此错误。

#100, "message"=>"Not enough permissions to access: GET /activities", "status"=>403}, @response=#, @headers={"x-li-responseorigin"=>["RGW"], "x-restli-gateway-error"=>["true"], "content-type"=>["application/json"], "content-length"=>["99"], "date"=>["Wed, 18 Dec 2019 08:49:46 GMT"], "x-li-fabric"=>["prod-lor1"], "report-to"=>["{\"group\":\"network-errors\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://www.linkedin.com/li/rep\"}],\"include_subdomains\":true}"], "nel"=>["{\"report_to\":\"network-errors\",\"max_age\":1296000,\"success_fraction\":0.00066,\"failure_fraction\":1,\"include_subdomains\":true}"], "x-li-pop"=>["prod-edc2"], "x-li-proto"=>["http/1.1"], "x-li-uuid"=>["TIOrmv5q4RUA16g7nSsAAA=="], "set-cookie"=>["lidc=\"b=OB67:g=1767:u=13:i=1576658986:t=1576741391:s=AQFS3auU0233cAdH3fKSL2EuVQDxEPAf\""], "x-li-route-key"=>["\"b=OB67:g=1767:u=13:i=1576658986:t=1576741391:s=AQFS3auU0233cAdH3fKSL2EuVQDxEPAf\""]}>"""

我在linkedin上发帖,作为回应,我得到了一个活动ID urn:li:activity:6628985933737926656

通过使用它,我尝试将其获取

DATA_URL ='https://api.linkedin.com' @token =我发布时使用的相同帐户的access_token。

response = HTTParty.get("#{DATA_URL}/v2/activities?ids=urn:li:activity:6628985933737926656", headers: { 'Authorization': "Bearer #{@token}" })

得到回应。

=> #<HTTParty::Response:0x78e9e30 parsed_response={"serviceErrorCode"=>100, "message"=>"Not enough permissions to access: GET /activities", "status"=>403}, @response=#<Net::HTTPForbidden 403 Forbidden readbody=true>, @headers={"x-li-responseorigin"=>["RGW"], "x-restli-gateway-error"=>["true"], "content-type"=>["application/json"], "content-length"=>["99"], "date"=>["Tue, 04 Feb 2020 05:56:31 GMT"], "x-li-fabric"=>["prod-lor1"], "x-li-pop"=>["prod-edc2"], "x-li-proto"=>["http/1.1"], "x-li-uuid"=>["p47TiGUd8BUQSeGHQSsAAA=="], "set-cookie"=>["lidc=\"b=OB67:g=1845:u=46:i=1580795791:t=1580855512:s=AQFUlGrlMzDtZUOi5wzacLDyR4CkfDGl\""], "x-li-route-key"=>["\"b=OB67:g=1845:u=46:i=1580795791:t=1580855512:s=AQFUlGrlMzDtZUOi5wzacLDyR4CkfDGl\""]}> 

0 个答案:

没有答案