Linkedin v2 api:没有足够的权限访问:GET/countriesV2 [英] Linkedin v2 api: Not enough permissions to access: GET /countriesV2
问题描述
使用LinkedIn v2 API获取组织关注者的统计信息时,我使用了国家/地区投影来获取国家/地区,地区,行业,职能的详细信息.但这仅对国家/地区造成了错误,其他详细信息也已包含在预期中.
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解析由于未知原因而失败.:com.linkedin.restligateway.exceptions.GatewayAccessException:没有足够的权限访问:GET/countriesV2
URN Resolution failed for unknown reasons.: com.linkedin.restligateway.exceptions.GatewayAccessException: Not enough permissions to access: 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" } ] }
但是当我直接查询国家/地区端点时,它将返回预期结果.谁能帮我解决这个问题.
But when i query countries endpoint directly it returns expected result. Can anyone help me resolve this.
推荐答案
问题在于使用 followerCountsByCountry *(*,country〜($ URN)).星号(*)最有可能是此特定端点的问题,您需要指定要投影的字段.可用字段的完整列表在这里: https://docs.microsoft.com/zh-CN/linkedin/shared/references/v2/standardized-data/locations/countries
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://docs.microsoft.com/en-us/linkedin/shared/references/v2/standardized-data/locations/countries
如果您使用 followerCountsByCountry *(followerCounts,country〜(name,countryGroup,countryCode))),则输出将如下所示:
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
}
}
这篇关于Linkedin v2 api:没有足够的权限访问:GET/countriesV2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!