Reputation: 1
I'm trying to get LinkedIn Ads statistic by member company accordingly to this doc: https://learn.microsoft.com/en-us/linkedin/marketing/integrations/ads-reporting/ads-reporting#analytics-finder
GET https://api.linkedin.com/v2/adAnalyticsV2?q=analytics&pivot=MEMBER_COMPANY&timeGranularity=DAILY
So, I got a response like this:
{
"paging": {
"start": 0,
"count": 1000,
"links": []
},
"elements": [
{
"clicks": 0,
"pivot": "MEMBER_COMPANY",
"pivotValue": "urn:li:organization:<some_org_id>",
"impressions": 3,
"externalWebsiteConversions": 0,
"dateRange": {
"start": {
"month": 6,
"day": 15,
"year": 2020
},
"end": {
"month": 6,
"day": 15,
"year": 2020
}
}
},
But "pivotValue" in the result isn't a human-readable hence I want to transform Organization URN to Organization Name. This article: https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/organizations/organization-lookup-api#retrieve-organizations says that if I want to lookup Organization information as
GET https://api.linkedin.com/v2/organizations/{some_org_id}
then I must have role type ADMINISTRATOR for that organization. Really, I receive a "403 Forbidden" response for organizations from adAnalyticsV2 response.
I've read about Organization Search API but it was not helpful.
Please advise how I can retrieve Organization Name by Organization ID or URN?
Upvotes: 0
Views: 694
Reputation: 11
You can use the parameter pivotValue~(localizedName) to retrieve the organization name. Example:
GET https://api.linkedin.com/v2/adAnalyticsV2?q=analytics&dateRange.start.year=2019&dateRange.start.month=5&dateRange.start.day=28&dateRange.end.year=2019&dateRange.end.month=9&dateRange.end.day=30&timeGranularity=DAILY&accounts=urn%3Ali%3AsponsoredAccount%3A502840441&pivot=MEMBER_COMPANY&projection=(*,elements*(externalWebsiteConversions,dateRange(*),impressions,landingPageClicks,likes,shares,costInLocalCurrency,pivot,pivotValue~(localizedName)))&fields=externalWebsiteConversions,dateRange,impressions,landingPageClicks,likes,shares,costInLocalCurrency,pivot,pivotValue
Upvotes: 1