Reputation: 760
For my project I am trying to extract flight booking information from a user's Google Calendar.
The key information I need is the Flight Confirmation Number, this is stored in the description of the Event.
This is the Response from Events: get
"kind": "calendar#event",
"etag": "\"3043267198652000\"",
"id": "_6tlnaq...o6e",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=XzZ0...QG0",
"created": "2018-03-07T00:12:22.000Z",
"updated": "2018-04-04T23:47:36.112Z",
"summary": "Flight to Sydney (PX 1)",
"description": "To see detailed information for automatically created events like this one, use the official Google Calendar app. https://g.co/calendar",
"location": "Port Moresby POM",
"creator": {
"email": "[email protected]",
"self": true
},
"organizer": {
"email": "[email protected]"
},
"start": {
"dateTime": "2018-04-21T15:00:00+10:00"
},
"end": {
"dateTime": "2018-04-21T18:55:00+10:00"
}
The description of this event has been replaced by this message:
"To see detailed information for automatically created events like this one, use the official Google Calendar app. https://g.co/calendar"
I have been unable to find any information on why this happens.
My workaround is to use the Gmail API to read the users' emails and extract the Flight Confirmation Number with a regular expression.
This is not preferable as it is prone to error and requires permission from the user to read their emails. I'd rather let Google extract this information since they are already doing it.
Is it possible access this information from an automatically created event? If not, why is Google restricting this information?
Upvotes: 2
Views: 939
Reputation: 117281
You need to understand that the Google Calendar API can only display the information that it has. The description for the event in question is
"To see detailed information for automatically created events like this one, use the official Google Calendar app. https://g.co/calendar"
Now if this is an event that was created by google and they have set the Google calendar web application to parse the information differently then there is really nothing you can do to change that. This is after all a free service.
If I where you i would try digging around in Extended properties it may actually be there. However i cant remember if extended properties are application specific there by locking it to only Google being able to see it.
Is it possible access this information from an automatically created event?
Not unless the data is hiden in extended properties some place.
If not, why is Google restricting this information?
My guess would be becouse they want users to use their application so they get to sell ads.
Upvotes: 1