Google Calendar ignoring timeZone parameter - google-api

I'm trying to add the stock moon phases calendar to a web site via the calendar API. But... the data always comes back in UTC. E.g., this get request
https://www.googleapis.com/calendar/v3/calendars/ht3jlfaac5lfd6263ulfh4tql8%40group.calendar.google.com/events?orderBy=startTime&singleEvents=true&timeMin=2017-10-31T00%3A00%3A00-05%3A00&timeMax=2018-01-07T00%3A00%3A00-05%3A00&maxResults=10&timeZone=America%2FNew_York&key={API_KEY}
gets me this response
{
"kind": "calendar#events",
"etag": "\"p32o9hktouumte0g\"",
"summary": "Phases of the Moon",
"updated": "2017-11-07T18:33:19.000Z",
"timeZone": "UTC",
"accessRole": "reader",
"defaultReminders": [],
"nextPageToken": "EiIKF21vb25waGFzZSsxNTA5NzcyOTgwMDAwGICAm7jOo9cC",
"items": [
{
"kind": "calendar#event",
"etag": "\"2453932800000000\"",
"id": "moonphase+1509772980000",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=bW9vbnBoYXNlKzE1MDk3NzI5ODAwMDAgaHQzamxmYWFjNWxmZDYyNjN1bGZoNHRxbDhAZw&ctz=America/New_York",
"created": "2008-11-18T00:00:00.000Z",
"updated": "2008-11-18T00:00:00.000Z",
"summary": "Full moon 5:23am",
"creator": {
"email": "ht3jlfaac5lfd6263ulfh4tql8#group.calendar.google.com",
"displayName": "Phases of the Moon",
"self": true
},
"organizer": {
"email": "ht3jlfaac5lfd6263ulfh4tql8#group.calendar.google.com",
"displayName": "Phases of the Moon",
"self": true
},
"start": {
"date": "2017-11-04"
},
"end": {
"date": "2017-11-05"
},
"visibility": "public",
"iCalUID": "moonphase+1509772980000#google.com",
"sequence": 0,
"gadget": {
"title": "Full moon 5:23am",
"iconLink": "https://ssl.gstatic.com/calendar/images/moon/full-moon.gif"
}
}
]
}
And you'll notice the timeZone is listed as UTC and the summary and description fields have text representations of the times which are in UTC. It seems to have sort-of recognized my timeZone in that htmlLink field shows the zone as America/New_York.
You might be thinking that's just the way it works, except....
If you go to the Google test page for this API at
https://developers.google.com/google-apps/calendar/v3/reference/events/list
And plug in those parameters, the calendar data comes back in zone America/New_York.
Any ideas on what the magic is to make that happen?

Related

Image data missing in Knowledge Graph search API

We are consuming Knowledge graph search API and we use image content from api output in our application. We used to get Below response with image image content highlighted below
https://kgsearch.googleapis.com/v1/entities:search?query=taylor+swift&key=API_KEY&limit=1&indent=True
{
"#context": {
"#vocab": "http://schema.org/",
"goog": "http://schema.googleapis.com/",
"resultScore": "goog:resultScore",
"detailedDescription": "goog:detailedDescription",
"EntitySearchResult": "goog:EntitySearchResult",
"kg": "http://g.co/kg"
},
"#type": "ItemList",
"itemListElement": [
{
"#type": "EntitySearchResult",
"result": {
"#id": "kg:/m/0dl567",
"name": "Taylor Swift",
"#type": [
"Thing",
"Person"
],
"description": "Singer-songwriter",
"image": {
"contentUrl": "https://t1.gstatic.com/images?q=tbn:ANd9GcQmVDAhjhWnN2OWys2ZMO3PGAhupp5tN2LwF_BJmiHgi19hf8Ku",
"url": "https://en.wikipedia.org/wiki/Taylor_Swift",
"license": "http://creativecommons.org/licenses/by-sa/2.0"
},
"detailedDescription": {
"articleBody": "Taylor Alison Swift is an American singer-songwriter and actress. Raised in Wyomissing, Pennsylvania, she moved to Nashville, Tennessee, at the age of 14 to pursue a career in country music. ",
"url": "http://en.wikipedia.org/wiki/Taylor_Swift",
"license": "https://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License"
},
"url": "http://taylorswift.com/"
},
"resultScore": 4850
}
]
}
Suddenly the image content with imageURl/URL/License is not appearing on the response. Is this data retired from api output? I sthere any api or any field in the same api output that fetus the image URL data?

Summary value of calendar object

I recognized that the return of CalendarList has changed. the summary value was person's name but now it returns email address.
my question is how can I get calendar name using calendar API?
tested url: https://developers.google.com/calendar/v3/reference/calendarList/list
◆ Before
{
"kind": "calendar#calendarList",
"items": [
{
"kind": "calendar#calendarListEntry",
"etag": "\"1578551131788000\"",
"id": "test#test.com",
"summary": "Test Calendar", // <-- calendar's name
"timeZone": "Asia/Tokyo",
◆Now
{
"kind": "calendar#calendarList",
"items": [
{
"kind": "calendar#calendarListEntry",
"etag": "\"1578551131788000\"",
"id": "test#test.com",
"summary": "test#test.com", // <-- email address
"timeZone": "Asia/Tokyo",
There is currently a bug in Google calendar. its not returning the title in the summary as it is documented to do Bug report can be found here.
Calendar.get on my primary calendar returns
{
"kind": "calendar#calendar",
"etag": "\"KfTgGrEyu1otuO_8YfN8ka6X3tg\"",
"id": "xxx#gmail.com",
"summary": "xxxx#gmail.com",
"description": "test",
"timeZone": "Europe/Copenhagen",
"conferenceProperties": {
"allowedConferenceSolutionTypes": [
"eventHangout"
]
}
}
The documentation states that a calendar resource should return
summary = Title of the calendar.

Bug: findMeetingTimes throws “AttendeesUnavailable” even for optional attendees

I'm trying to use the https://outlook.office.com/api/v2.0/me/findmeetingtimes endpoint documented on the MSDN Outlook Calendar website. When I call the endpoint with the following payload:
{
"Attendees": [
{
"Type": "optional",
"EmailAddress": {
"Name": "Studio 3",
"Address": "PDXICSTUDIO3#rogueInc.onmicrosoft.com"
}
}
],
"TimeConstraint": {
"ActivityDomain":"Unrestricted",
"Timeslots": [
{
"Start": {
"DateTime": "2018-10-30T19:30:00",
"TimeZone": "UTC"
},
"End": {
"DateTime": "2018-10-30T20:30:00",
"TimeZone": "UTC"
}
}
]
},
"ReturnSuggestionReasons": "true",
"IsOrganizerOptional": false,
"MaxCandidates": 99
}
I get an empty meeting time suggestions response with the reason provided as "AttendeesUnavailable". It doesn't seem to matter whether I declare the type of the attendee as "optional", "required", or "resource" as specified in the attendeeBase Resource Type documentation. This seems like a bug with the GraphAPI and I'm unsure as to how to proceed.

How to use YouTube API to check if a video is restricted?

When embedding this YouTube video for example, we get This video contains content from... who has blocked it from display on the website error message.
How can I use the API to find if a video is blocked or not?
The nearest parameters I found are status and contentDetails:
GET https://www.googleapis.com/youtube/v3/videos?part=status&id=dYQ2IyMuPes&key={YOUR_API_KEY}
Which returns no indication about the restriction:
"contentDetails": {
"duration": "PT2M",
"dimension": "2d",
"definition": "hd",
"caption": "false",
"licensedContent": true,
"projection": "rectangular"
},
"status": {
"uploadStatus": "processed",
"privacyStatus": "public",
"license": "youtube",
"embeddable": true,
"publicStatsViewable": false
}
Check if it is restricted in the region contentDetails.regionRestriction or age-restricted content contentDetails.contentRating or content claimed by partner contentDetails.licensedContent? I am just speculating here too.
Edit: You can use this to check if it is embeddable too status.embeddable.
Be sure to have the "part" set correctly. It's a required field and you probably have "snippet there" and you need "contentDetails". (or "snippet,contentDetails" for both)
Example:
GET https://www.googleapis.com/youtube/v3/videos?part=contentDetails&id=OoKpYXTmYak&key={YOUR_API_KEY}
{
"kind": "youtube#videoListResponse",
"etag": "\"XpPGQXPnxQJhLgs6enD_n8JR4Qk/Xn7P-qyclepPOIFp9Bn69FdtR-4\"",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 1
},
"items": [
{
"kind": "youtube#video",
"etag": "\"XpPGQXPnxQJhLgs6enD_n8JR4Qk/_vu8XkjotVqxtJKQ2peTcRK8TYE\"",
"id": "OoKpYXTmYak",
"contentDetails": {
"duration": "PT1M41S",
"dimension": "2d",
"definition": "hd",
"caption": "false",
"licensedContent": true,
"regionRestriction": {
"allowed": [
"ES",
"US"
]
},
"projection": "rectangular"
}
}
]
}
This is allowed in the US and Spain only

How to get filtered activity stream using Yammer API?

Yammer Activity Stream is available at:
https://www.yammer.com/api/v1/streams/activities.json?access_token=
This successfully results in all the recent activities like:
{
"items": [
{
"id": "/users/www.yammer.com-341514-1508953644/rollups/45191477209921-45191477209921",
"unseen": true,
"icon": "/images/notifications/page_add.png",
"icon_name": null,
"category": "file-create",
"message": "[[user:1508783078]] uploaded [[uploaded_file:24511980]].",
"heading": "",
"created_at": "2014/10/02 07:07:42 +0000",
"objects": [],
"actions": [],
"subject": {
"type": "uploaded_file",
"id": 24511980
},
"meta": null,
"client_type": "unknown",
"client_url": "https://www.yammer.com",
"client_icon": "https://mug0.assets-yammer.com/mugshot/images/16x16/3rd_party.png",
"client_large_icon": "https://mug0.assets-yammer.com/mugshot/images/75x75/3rd_party.png",
"image": "https://mug0.assets-yammer.com/mugshot/images/48x48/no_photo.png",
"third_party": false
},
{
"id": "/users/www.yammer.com-341514-1508953644/rollups/45191475863746-45191475863746",
"unseen": true,
"icon": "/images/notifications/page_add.png",
"icon_name": "page",
"category": "file-download",
"message": "[[user:1508783078]] downloaded [[uploaded_file:24373320]] from the [[group:3455089]] group.",
"heading": "",
"created_at": "2014/10/02 07:07:00 +0000",
"objects": [
{
"id": 24373320,
"type": "uploaded_file"
}
],
"actions": [],
"subject": {
"type": "uploaded_file",
"id": 24373320
},
"meta": null,
"client_type": "unknown",
"client_url": "https://www.yammer.com",
"client_icon": "https://mug0.assets-yammer.com/mugshot/images/16x16/3rd_party.png",
"client_large_icon": "https://mug0.assets-yammer.com/mugshot/images/75x75/3rd_party.png",
"image": "https://mug0.assets-yammer.com/mugshot/images/48x48/no_photo.png",
"third_party": false
},
]}
QUESTION:
I am trying to get all the recent activities after a certain time-stamp or after a certain offset. Is there any query parameter for that?
this is
older_than="/users/www.yammer.com-341514-1508953644/rollups/45191475863746-45191475863746"
that would return all the activities older than the last activities you shew in your sample return value

Resources