2

Using the linkedIn Video Analytics API, I want to gather analytics about my video post per day.

My request:

https://api.linkedin.com/v2/videoAnalytics?q=entity&entity=urn:li:ugcPost:6662300354706755584&type=VIEWER&timeRange=(start:1588416100,end:1590624000)&aggregation=DAY

However, I keep receiving the following error:

{"message":"Parameter 'timeRange' is invalid","status":400}

I tried changing the timeRange from miliseconds to epoch time, but that did not make a difference. Please, can anyone help to solve this issue here?

Thanks in advance.

SuzanneB
  • 23
  • 3

2 Answers2

0

You could split the timeRange in two different query string params:

So, instead of:

&timeRange=(start:1588416100,end:1590624000)&...

You could use:

&timeRange.start=1588416100&timeRange.end:1590624000&...

So the final url could be:

https://api.linkedin.com/v2/videoAnalytics?q=entity&entity=urn:li:ugcPost:6662300354706755584&type=VIEWER&timeRange.start:1588416100&timeRange.end:1590624000&aggregation=DAY

I've tried with success. Hope this works for you

NB: Remember that timestamp is in milliseconds

Matteo
  • 37,680
  • 11
  • 100
  • 115
0

it depends on the version of Restli-Protocol-Version" you are using
if you are using Restli 1.0. then your request should look like this

&timeIntervals.timeGranularityType=DAY&timeIntervals.timeRange.start=1551398400000&timeIntervals.timeRange.end=1552003200000


if you are using Restli 2.0 then your request should look like this

&timeIntervals=(timeRange:(start:1551398400000,end:1552003200000),timeGranularityType:DAY)
Tariq Husein
  • 186
  • 1
  • 9
  • Interesting, I've tried adding the header about. the Restli api version without any success. Could you please improve your answer about the requested endpoint? Thanks! – Matteo Jun 03 '20 at 08:48