не удается получить запись в профиле пользователя с помощью `GET / activity` - PullRequest
0 голосов
/ 03 февраля 2020

Получение этой ошибки.

#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, и в ответ я получил идентификатор активности 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\""]}> 
...