【问题标题】:Linkedin v2 api: Not enough permissions to access: GET /countriesV2Linkedin v2 api:访问权限不足:GET /countriesV2
【发布时间】:2020-09-04 19:00:39
【问题描述】:

在使用 LinkedIn v2 API 获取组织关注者统计数据时,我还使用国家/地区投影来获取国家、地区、行业、功能详细信息。但它仅对国家/地区抛出错误,其他详细信息按预期包含在内。

URN 解析失败,原因不明。:com.linkedin.restligateway.exceptions.GatewayAccessException:没有足够的访问权限:GET /countriesV2

我的查询是

curl "https://api.linkedin.com/v2/organizationalEntityFollowerStatistics?q=organizationalEntity&organizationalEntity=urn:li:organization:12345&projection=(elements*(*,followerCountsByRegion*(*,region~($URN)),followerCountsByCountry*(*,country~($URN)),followerCountsBySeniority*(*,seniority~($URN)),followerCountsByIndustry*(*,industry~($URN)),followerCountsByFunction*(*,function~($URN))))&oauth2_access_token=XXX"

回应

{elements[... [{ "country" : "urn:li:country:cn", "followerCounts" : { "organicFollowerCount" : 1, "paidFollowerCount" : 0 }, "country!" : { "message" : "URN Resolution failed for unknown reasons.: com.linkedin.restligateway.exceptions.GatewayAccessException: Not enough permissions to access: GET /countriesV2", "status" : 500 } } ], "organizationalEntity" : "urn:li:organization:12345" } ] }

但是当我直接查询国家端点时,它会返回预期结果。 谁能帮我解决这个问题。

【问题讨论】:

    标签: linkedin linkedin-api


    【解决方案1】:

    问题在于使用 followerCountsByCountry*(*,country~($URN))。星号 (*) 很可能是此特定端点的问题,您需要指定要投影的字段。可用字段的完整列表在这里:https://docs.microsoft.com/en-us/linkedin/shared/references/v2/standardized-data/locations/countries

    如果您使用 followerCountsByCountry*(followerCounts,country~(name,countryGroup,countryCode))) 代替,输出将如下:

    {"country": "urn:li:country:br",
       "country~": {
              "countryCode": "br",
              "countryGroup": "urn:li:countryGroup:LA",
              "name": {
                "locale": {
                  "country": "US",
                  "language": "en"
                },
                "value": "Brazil"
              }
            },
            "followerCounts": {
              "organicFollowerCount": 368,
              "paidFollowerCount": 0
            }
          }
    

    【讨论】:

      猜你喜欢
      • 2019-02-27
      • 2018-02-19
      • 2019-06-02
      • 1970-01-01
      • 2019-05-13
      • 1970-01-01
      • 2019-11-15
      • 1970-01-01
      • 2019-11-14
      相关资源
      最近更新 更多