1

While fetching organization follower statistics using LinkedIn v2 API I used country projection to get country, region, industries, functions details also. But it throws error for countries alone, other details are included as expected.

URN Resolution failed for unknown reasons.: com.linkedin.restligateway.exceptions.GatewayAccessException: Not enough permissions to access: GET /countriesV2

My query is

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"

Response

{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" } ] }

But when i query countries endpoint directly it returns expected result. Can anyone help me resolve this.

1 Answers1

0

The problem is with using followerCountsByCountry*(*,country~($URN)). Most likely the asterisk (*) is the issue for this particular endpoint, you need to specify the fields you want to project. The full list of available fields is here : https://learn.microsoft.com/en-us/linkedin/shared/references/v2/standardized-data/locations/countries

If you use followerCountsByCountry*(followerCounts,country~(name,countryGroup,countryCode))) instead, the output will be as follows:

{"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
        }
      }