I want to fetch video analytics by date range.
I followed Video Analytics API,
https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/video-analytics-api
But I get an error.
Didn't find any other reference in the Web.
It should be noted that I fetch lifetime data (without time range parameter) successfully and that encodeURIComponent didn't help.
The request:
https://api.linkedin.com/v2/videoAnalytics?q=entity&entity=urn:li:ugcPost:6516733420171780096&type=VIEWER&aggregation=DAY&timeRange=(start:1553385600000,end:1553817600000)
The error:
{
"message": "Parameter 'timeRange' is invalid",
"status": 400
}
Edit:
using epoch - no error, but also no metrics data
even I got metrics in fetching lifetime, when fetching dateRange, and I tried several date ranges from video creation date until today - returns empty array.
{
"elements": [],
"paging": {
"total": 0,
"count": 10,
"start": 0,
"links": [],
}
}
trying fetching ALL - to mimic lifetime - also returns empty array:
https:/api.linkedin.com/v2/videoAnalytics?q=entity&entity=urn%3Ali%3AugcPost%3A6516733420171780096&type=VIEWER&timeRange=(start:1552176000,end:1564012800)&aggregation=ALL
weird - even trying to get an error by switching start date and end date returns empty array.
You need epoch time, not miliseconds
Try replacing time with
start:1563969600,end:1564401600
Converter -> https://www.epochconverter.com/
Related
Im using the Firebase REST API to retrieve data with the GET method, this is the URL im executing:
const url = `https://firestore.googleapis.com/v1/projects/${projectId}/databases/${dataBase}/documents/${collectionName}/${documentId}?&key=${apiKey}&pageSize=${pageSize}&pageToken=${nextPageToken}&orderBy=timestamp&startAt=${startTime}`;
But it return this error:
{
"error": {
"code": 400,
"message": "Invalid JSON payload received. Unknown name \"startAt\": Cannot bind query parameter. Field 'startAt' could not be found in request message.",
"status": "INVALID_ARGUMENT",
"details": [
{
"#type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"description": "Invalid JSON payload received. Unknown name \"startAt\": Cannot bind query parameter. Field 'startAt' could not be found in request message."
}
]
}
]
}
}
If im omitting the paramemeter of startAt it works fine.
The format of startTime, id try it in all the following ways, and all return the same error:
Firebase return format: 2022-06-16T15:46:46.061Z
Unix Timestamp:1655394406
ISO 8601 date: 2022-06-16T15:46:46+00:00
What im doing wrong?
(For reference here is the official documentation where the startAt is explained)
You're calling the Firestore REST API, but are referencing the documentation for the REST API of the Realtime Database. While both products are part of Firebase, they are complete separate - and the API of one cannot be applied to the other.
For the documentation of the Firestore REST API, see https://firebase.google.com/docs/firestore/reference/rest
Right now it looks like a mystery. Please help me in solving it.
I use iTunes public API to fetch an album: "Metallica" by Metallica (see it in browser: US region, MV region). I construct the following URLs to fetch it via API:
US region https://itunes.apple.com/lookup?id=579372950&country=US&entity=album - works
MV region https://itunes.apple.com/lookup?id=579372950&country=MV&entity=album - doesn't work
Here's the actual behaviour I observe:
If I query GET https://itunes.apple.com/lookup?id=579372950&country=MV&entity=album in a Spring app (using RestTemplate + Jackson HttpMessageConverter) I get an empty response:
{
"resultCount":0,
"results": []
}
If I navigate to https://itunes.apple.com/lookup?id=579372950&country=MV&entity=album in a browser I get a file download prompt. The file contains an empty response:
{
"resultCount":0,
"results": []
}
If I query API using HttpPie http get https://itunes.apple.com/lookup?id=579372950&country=MV&entity=album I get a non-empty response !!!
{
"resultCount": 1,
"results": [
{
"amgArtistId": 4906,
"artistId": 3996865,
"artistName": "Metallica",
"artistViewUrl": "https://music.apple.com/us/artist/metallica/3996865?uo=4",
"artworkUrl100": "https://is1-ssl.mzstatic.com/image/thumb/Music/v4/0b/9c/d2/0b9cd2e7-6e76-8912-0357-14780cc2616a/source/100x100bb.jpg",
"artworkUrl60": "https://is1-ssl.mzstatic.com/image/thumb/Music/v4/0b/9c/d2/0b9cd2e7-6e76-8912-0357-14780cc2616a/source/60x60bb.jpg",
"collectionCensoredName": "Metallica",
"collectionExplicitness": "notExplicit",
"collectionId": 579372950,
"collectionName": "Metallica",
"collectionPrice": 9.99,
"collectionType": "Album",
"collectionViewUrl": "https://music.apple.com/us/album/metallica/579372950?uo=4",
"copyright": "℗ 1991 Blackened Recordings",
"country": "USA",
"currency": "USD",
"primaryGenreName": "Metal",
"releaseDate": "1991-08-12T07:00:00Z",
"trackCount": 13,
"wrapperType": "collection"
}
]
}
I tried it multiple times and the results seem to be consistent. I compared the requests and they seem to be identical.
Why does iTunes respond differently to different clients? I can't understand. What important detail am I missing?
Similar questions:
Spring RestTemplate getForObject URL not working for Apple iTunes - there's another problem (double encoding of the whitespace character).
This problem happens to the following regions (it's a complete list):
LI https://itunes.apple.com/lookup?id=579372950&country=LI&entity=album
MV https://itunes.apple.com/lookup?id=579372950&country=MV&entity=album
MM https://itunes.apple.com/lookup?id=579372950&country=MM&entity=album
ET https://itunes.apple.com/lookup?id=579372950&country=ET&entity=album
RS https://itunes.apple.com/lookup?id=579372950&country=RS&entity=album
I spotted a difference:
http get 'https://itunes.apple.com/lookup?id=579372950&country=MV&entity=album' -> empty response
curl 'https://itunes.apple.com/lookup?id=579372950&country=MV&entity=album' -> empty response
http get https://itunes.apple.com/lookup?id=579372950&country=MV&entity=album -> 1 album in response
curl https://itunes.apple.com/lookup?id=579372950&country=MV&entity=album -> 1 album in response
if I don't use quotes around URL, the request is interpreted as GET https://itunes.apple.com/lookup?id=579372950. the default country is US and therefore I see 1 US album in response.
Could you please help to filter below JSON using eventId?
{
"-Kb2dYPV0yUXpD_1moc9": {
"eventId": 1,
"message": "sdfsdfsf",
"sentOn": 1485004202943
},
"-Kb2etFm1xHd8sSsESeK": {
"eventId": 1,
"message": "shdfhsf",
"sentOn": 1485004553847
},
"-Kb2etKON8nWVKS2R0sj": {
"eventId": 2,
"message": "shdfhsf",
"sentOn": 1485004553853
}
}
I'm using below URL,
https://xxxxxxxx.firebaseio.com/chats.json?orderBy="eventId"&equalTo=1
but getting constraint index field must be a json primitive error.
I want to retrieve chat objects with respect to particular event ID. I referred to the REST API, there, it was explained with simple JSON.
Please help me.
I've run into the same error before using the firebase REST api, and it was because I didn't have quotes around the value in the equalTo clause (e.g. equalTo="1")
I'm having user vertices which have incoming Notification edges as follows:
code am using to get notifications
g.v(17929472).outE('Notification')
Response I'm getting :
{
"success": true,
"results": [
{
"Type": "UserReaction",
"PostedDate": "2016-04-15T09:03:42.8391677Z",
"NotificationInitiatedByVertexId": "2304",
"_id": "c7bb4-aoagw-sgl-aoao0",
"_type": "edge",
"_outV": 17929472,
"_inV": 17929728,
"_label": "Notification"
}
],
"version": "2.5.0",
"queryTime": 15.310751
}
Whenever user view the notification i'm saving the last seen date and want to use that date to get all notification that is present after that date.
I've tried :
g.v((5124096).outE).outE.has('PostedDate',T.gte, 2016-04-15T07:52:31.6979843Z).inV
but it is giving error.
PostedDate appears to be returned as a String. Consider defining PostedDate in your schema definition as a Long instead, and then do the T.gte comparison with a Long value.
I am trying to retrieve events from a Google calendar. I am calling this URL:
GET https://www.googleapis.com/calendar/v3/calendars/riteshmehandiratta%40gmail.com/events
Authorization: Bearer ya29.AHES6ZSvz3O7V2p7z_k_ZWAiUZqWX35Eyx5V_J4XC5pVSNxLjS6CNzQ
and I am getting this response:
{
"kind": "calendar#events",
"etag": "\"ZrhdJMCgpoUK_a5fT7XOC6xn46g/_4_AQ2FVvAtAEiDFDj8_pH_usqc\"",
"summary": "riteshmehandiratta#gmail.com",
"updated": "2013-02-18T03:45:37.728Z",
"timeZone": "Asia/Calcutta",
"accessRole": "owner",
"defaultReminders": [
{
"method": "email",
"minutes": 10
},
{
"method": "popup",
"minutes": 10
}
],
"nextPageToken": "CigKGnR0ZG1xbjAyNHQ1Y3RycjYwY2x0ZGxtcTk0GAEggIDA28aNo-cT"
}
There are many events in the calendar for the past, future and for the current date.
Why its not giving the calendar event list?
there is definitely something weird here, in the response you are posting, i see you are getting the nextPageToken tag, so there actually ARE more results, you can call the next result "page", using a similar request with the variable pageToken added, something like
GET https://www.googleapis.com/calendar/v3/calendars/riteshmehandiratta%40gmail.com/events?pageToken=CigKGnR0ZG1xbjAyNHQ1Y3RycjYwY2x0ZGxtcTk0GAEggIDA28aNo-cT
that way you'll get more results.
Anyway this is weird because the nextPageToken doesn't show up if you don't limit the query with some variable like maxResults. Please check if you are not limiting the query somewhere else.
Maybe you can find useful for making test, the documentation page, that has at the bottom a request form that can build the query for you.
Hope this helps, regards
I saw the same problem. Sometimes the list API will return an empty item list with a nextPageToken, even if I did not limit the number of responses. The solution is to check if there is a nextPageToken, and make another request for the next page until you get a response without a nextPageToken.
I looped through the requests until there wasn't a nextPage token, appending the event lists to a local list, and this provided a full list of the events.