Hi Doug,
I found out another problem with NodeJS SDK and client.analyticsVideo.get(videoId, period);
method.
If a range interval syntax is used for the period
parameter as 2020/2021
or 2021-01/2021-02
or 2021-W01/2021-W10
, then no analytic is returned (when exists in fact), and even an extra error (status: 500) / message is printed on a console, like below.
If the range interval syntax is used for the period
parameter as 2021-02-10/2021-02-13
, then no analytic is returned (when exists in fact), but the extra error message doesn’t show on a console.
If the range interval syntax is not used, and the period is an exact year, year-month, year-week, year-month-day, then the method works as expected.
PS: The GET URL shows that query params currentPage=1&pageSize=100
are sent to a server by default. It’s unclear because the official API docs of client.analyticsVideo.get(videoId, period);
doesn’t mention any possibilities for passing of currentPage
or pageSize
.
GET https://sandbox.api.video/analytics/videos/vi1YR8HyNZZu2qkS9ASxhWRi?currentPage=1&pageSize=100&period=2021-W01%2F2021-W10
Headers: {
'user-agent': 'api.video SDK (nodejs; v:1.9.8)',
accept: 'application/json',
authorization: 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjZhN.........mXxcl5X59h5u5R8bw',
'accept-encoding': 'gzip, deflate, br'
}
Response:
Headers: {
server: 'nginx',
'content-type': 'application/problem+json',
'transfer-encoding': 'chunked',
connection: 'close',
'cache-control': 'no-cache, private',
date: 'Sat, 13 Feb 2021 15:16:08 GMT',
'api-version': '1.0',
'x-whom': 'ovh-gra-api-web-app-001-api',
'timing-allow-origin': '*',
'access-control-allow-origin': '*',
'access-control-expose-headers': 'Content-Length,Content-Range'
}
Body: {
status: 500,
type: 'https://docs.api.video/5.1/problems/internal_server_error',
title: 'A server error occurred.',
name: ''
}
Can you look at it?
Milos