Getting the error when fetching ad analytics from the API. The URL used: https://api.linkedin.com/v2/adAnalyticsV2?q=analytics
Other URL options sent along with the request (dummy account ID used):
{
'accounts[0]': 'urn:li:sponsoredAccount:1234'
'dateRange.start.year': 2017,
'dateRange.start.month': 12,
'dateRange.start.day': 1,
'dateRange.end.year': 2017,
'dateRange.end.month': 12,
'dateRange.end.day': 22,
timeGranularity: 'DAILY',
pivot: [ 'MEMBER_JOB_TITLE' ]
}
So the full request becomes:
GET https://api.linkedin.com/v2/adAnalyticsV2?q=analytics&accounts[0]=urn:li:sponsoredAccount:1234&dateRange.start.year=2017&dateRange.start.month=12&dateRange.start.day=1&dateRange.end.year=2017&dateRange.end.month=12&dateRange.end.day=22&timeGranularity=DAILY&pivot=MEMBER_JOB_TITLE
This request worked earlier today, but now it returns an Internal Server Error. Does anyone else have this issue or know what I might be doing wrong? Thanks in advance.
It looks like you may be trying to pass in the options in the request body. To use the Ad Analytics API, you will need to pass in the options as query parameters in a GET request:
GET https://api.linkedin.com/v2/adAnalyticsV2?q=analytics&dateRange.start.month=12&dateRange.start.day=1&dateRange.start.year=2017&timeGranularity=DAILY&pivot=MEMBER_JOB_TITLE&accounts[0]=urn:li:sponsoredAccount:1234
Related
Until December 12th 2022, I was able to combine fullPageUrl and averageSessionDuration in run report requests to the
Following endpoint
https://analyticsdata.googleapis.com/v1beta/properties/xxxxxxxxxx:runReport
If you go dimensions and metrics exporer and select the dimension "fullPageUrl", you can no longer select "averageSessionDuration". They are incompatible now.
My request body in JSON looks like this:
{"dimensions":[{"name":"date"},{"name":"fullPageUrl"},
{"name":"pageTitle"},],"metrics":[{"name":"averageSessionDuration"},{"name":"userEngagementDuration"},],"dateRanges":[{"startDate":"7daysAgo","endDate":"today"}]}
I get this error message as a reply:
{
"error": {
"code": 400,
"message": "Please remove averageSessionDuration to make the request compatible. The request's dimensions & metrics are incompatible. To learn more, see https://ga-dev-tools.web.app/ga4/dimensions-metrics-explorer/",
"status": "INVALID_ARGUMENT"
}
}
I couldnt find anything in the documentation or in the changelogs.
The Google analytics data api is in beta it is not completed which means that they are still tuning it.
Your issue is that "fullPageUrl" and "averageSessionDuration" are not longer compatible you cant use them together in a report.
That being said I cant find any mention of it in the change log so I am going to contact the team and see what they have to say.
I am trying to get some information about a specific LinkedIn campaign, but I'm getting an empty 'elements' array as response.
The catch is that the campaign has zero in all metrics when looking on the Campaign Manager. I think it was never actually veiculated, because even the cost is zero (and the status is COMPLETED).
My doubt is: should the array actually be empty, or be filled with zero on the values of the metrics and I'm messing up the requests?
This is what I'm doing:
First a GET request to see all campaigns that are associated with that Token:
GET https://api.linkedin.com/v2/adCampaignsV2?q=search
and this a part of the response:
...
"costType": "CPC",
"name": "Posts",
"offsiteDeliveryEnabled": true
"id": 128237464,
...
Then another GET request to see the info about that campaign:
GET https://api.linkedin.com/v2/adAnalyticsV2?q=analytics&pivot=CAMPAIGN&dateRange.start.day=25&dateRange.start.month=6&dateRange.start.year=2019&timeGranularity=MONTHLY&campaigns[0]=urn:li:sponsoredCampaign:128237464
But this is the response:
{
"elements": [],
"paging": {
"count": 10,
"start": 0,
"links": []
}
}
My app has the r_ads_reporting permission and Development tier on the Marketing Developer Platform.
I've also manually added the account ID of that company on the MDP Settings.
The problem was in the campaigns I used. After this I tested with some campaigns that had real ads and I got the expected response
UPDATE: It's happening again, also with Fleet API. Please see additional examples at end of the post.
I'm using HERE's REST API to calculate a route, then ask for additional data for each link / route segment by querying HERE's Platform Data Extension (PDE). This usually works fine, but now I've run into a link id that is not recognised by PDE.
Are these services not in sync, or am I doing something wrong?
I didn't have any issue in the past weeks, and it still works fine for most link ids, so this could either be a new problem or a very singular issue. I searched in the HERE API documentation and on Stackoverflow, but couldn't find anything related.
Route request (A24 Berlin towards Hamburg): https://route.api.here.com/routing/7.2/calculateroute.json?waypoint0=geo!52.7091,13.0356&waypoint1=geo!52.7193,12.9608&mode=fastest;car;traffic:disabled&representation=navigation&app_id=xxx&app_code=yyy
The json response (below) contains a link with permanent id 1199057935 at Anschlussstelle Kremmen.
The PDE request gives an empty response: https://pde.api.here.com/1/index.json?layer=ROAD_GEOM_FCn&attributes=LINK_ID&values=1199057935&app_id=xxx&app_code=yyy
{"Layers":[]}
Instead, I would expect the data of the containing tile, e.g. what I get for 1199057936
{"Layers":[{"layer":"ROAD_GEOM_FC1","level":9,"tileXYs":[{"x":548,"y":405}]}]}
I also tried the PDE request with ROAD_GEOM_FC1 and prefixing the id with + (values=+1199057935). Other link ids of the route return the expected tile information.
For completeness, here's the link's json from the routing response:
{
"linkId":"+1199057935",
"shape":["52.7175629,12.976613","52.7177131,12.9749393"],
"firstPoint":28,
"lastPoint":29,
"length":114,
"remainDistance":1095,
"remainTime":39,
"nextLink":"+1199057936",
"maneuver":"M2",
"speedLimit":33.3333359,
"dynamicSpeedInfo":{"trafficSpeed":16.3888893,"trafficTime":7,"baseSpeed":27.5,"baseTime":4,"jamFactor":5.7118645},
"flags":["motorway"],
"functionalClass":1,
"roadNumber":"A24",
"timezone":"+0100",
"roadName":"",
"consumption":0,
"_type":"PrivateTransportLinkType"
}
UPDATE 2019-05-27:
I get a route that contains link id 1239826684 from https://route.api.here.com/routing/7.2/calculateroute.json?waypoint0=geo!52.5066,13.4299&waypoint1=geo!52.5282,13.4265&mode=fastest;car;traffic:disabled&representation=navigation&app_id=xxx&app_code=yyy
Using fleet endpoint redirects to same call as above, including link id 1239826684: https://fleet.api.here.com/2/calculateroute.json?waypoint0=geo!52.5066,13.4299&waypoint1=geo!52.5282,13.4265&mode=fastest;car;traffic:disabled&representation=navigation&app_id=xxx&app_code=yyy
PDE returns [] for that link id: https://pde.api.here.com/1/index.json?layer=ROAD_GEOM_FCn&attributes=LINK_ID&values=1239826684&app_id=xxx&app_code=yyy
Fleet API returns [] for that link id: http://fleet.cit.api.here.com/1/index.json?layer=ROAD_GEOM_FCn&attributes=LINK_ID&values=1239826684&app_id=xxx&app_code=yyy
Seems the underlying geo-data is not in sync, and using different APIs does not help. Any other solution?
You can try Fleet telematics group of API's over basic routing and PDE as Fleet Telematics provides whole routing solution .
Please find the below API request which is giving expected response for the id-1199057935
http://fleet.cit.api.here.com/1/index.json?layer=ROAD_GEOM_FCn&attributes=LINK_ID&values=1199057935&app_id=xxxx&app_code=yyyy
Response :
{
Layers: [
{
layer: "ROAD_GEOM_FC1",
level: 9,
tileXYs: [
{
x: 548,
y: 405
}
]
}
]
}
for more information kindly go through the below documentation
https://developer.here.com/documentation/fleet-telematics/api-reference.html#operation%2FindexJSONUsingGET
Hope this will help.
Using LinkedIn Ads API document on this page -> https://learn.microsoft.com/en-us/linkedin/marketing/integrations/ads/account-structure/create-and-manage-campaign-groups#search-for-campaign-groups
If I search for campaign groups with completed status, it will always return 400 Bad Request with following message
{
"message": "{field=ID, order=ASCENDING} does not provide a valid value for sort.field for CampaignGroupSort. The acceptable values for field: ID,ACCOUNT,NAME",
"status": 400
}
As you can see from the message itself, I've already used ID as sort's field. Following is a request url that causing error
https://api.linkedin.com/v2/adCampaignGroupsV2?q=search&sort.field=ID&sort.order=ASCENDING&search.status.values[0]=COMPLETED
However, this issue doesn't happened if I just changed search.status.values from COMPLETED to something else e.g. ACTIVE. Like the following request
https://api.linkedin.com/v2/adCampaignGroupsV2?q=search&sort.field=ID&sort.order=ASCENDING&search.status.values[0]=ACTIVE
Above request returns with http status 200 with success result.
I've tried many combinations with no luck. Anyone can help please?
https://api.linkedin.com/v2/adCampaignGroupsV2?q=search&sort.field=ID&sort.order=ASCENDING&search.status.values[0]=COMPLETD
There is a typo in COMPLETED for your search.status.values[0].
When starting a Group Discussion through the LinkedIn website you can enter a postTitle and (optional) postText
However when querying this post through the LinkedIn API only the "title" is returned.
https://api.linkedin.com/v1/posts/{post-id}
Tested from https://apigee.com/console/linkedin to confirm it wasn't just my script with issues.
Is there an extra parameter I can pass to the API to get this "text" field on a Group Discussion post?
Thanks
You need to use the field selectors to specify the particular fields that you want returned from your call.
For example:
https://api.linkedin.com/v1/groups/12345:(id,name,site-group-url,posts:(id,summary,creator))
Please also note that as of May 12th, 2015, the API endpoint for Groups will no longer be publicly available. See the following blog post for more details: https://developer.linkedin.com/blog/posts/2015/developer-program-changes