Google calendar gadget: How to fetch UID from clicked Event in calendar
Asked Answered
G

0

7

This is a sidebar gadget that listens on event click and returns me event info (More Info):

<Module>
  <ModulePrefs title="subscribeToEvents Test" height="200" author="me"
    <Optional feature="google.calendar-0.5.read"/>
</ModulePrefs>
  <Content type="html">
  <![CDATA[
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  "http://www.w3.org/TR/html4/strict.dtd">
<html>
<body>
   <div id="out">No event</div>

<script>

function subscribeEventsCallback(e) {

  var html = 'No event';
  if (e) {
    html = gadgets.json.stringify(e);
  }
  document.getElementById('out').innerHTML = gadgets.util.escapeString(html);
}

///https://www.google.com/calendar/b/1/render?gadgeturl=http://devblog.meeterapp.com/wp-content/uploads/2015/03/fess_subscribe_to_dates.xml#main_7
// The gadget containers request that we do NOT run any JS inline.
// Instead, register a callback handler.
gadgets.util.registerOnLoadHandler(function() {
  google.calendar.read.subscribeToEvents(subscribeEventsCallback);
});


function showEvent(){
    google.calendar.showEvent(localEevent.id);
}

</script>
</body>
</html>
  ]]></Content>
</Module>

The problem is: the JSON that Google returns me has id but not UID,

Its unique id for google Calendar internal usage.

for example if user clicks on some event on Google calendar I get back this JSON:

{
  "timezone": "Asia/Jerusalem",
  "startTime": {
    "year": 2015,
    "month": 7,
    "date": 6,
    "hour": 14,
    "minute": 0,
    "second": 0
  },
  "endTime": {
    "year": 2015,
    "month": 7,
    "date": 6,
    "hour": 15,
    "minute": 0,
    "second": 0
  },
  "title": "Testing",
  "location": "",
  "id": "bGxwb3VoZXJkcGYyY2NlaDluMW41dWRvNm9gc2hvdXN0aW5AbQ",
  "status": "invited",
  "color": "#DB7972",
  "palette": {
    "darkest": "#D06B64",
    "dark": "#924420",
    "medium": "#D06B64",
    "light": "#DB7972",
    "lightest": "#F0D0CE"
  },
  "attendees": [],
  "attendeeCount": 0,
  "calendar": {
    "email": "[email protected]"
  },
  "creator": {
    "email": "[email protected]"
  },
  "owner": {
    "email": "[email protected]"
  },
  "accessLevel": "owner"
}



we have "id": "bGxwb3VoZXJkcGYyY2NlaDluMW41dWRvNm9gc2hvdXN0aW5AbQ", that is used for google.calendar.showEvent("bGxwb3VoZXJkcGYyY2NlaDluMW41dWRvNm9gc2hvdXN0aW5AbQ")

How to fetch meeting UID for example [email protected]

Please help,

Graciagracie answered 21/7, 2015 at 6:51 Comment(2)
Is that the iCalUID? The way you're getting event info does not include iCalUID, it just gets event info that describes the event on screen. More details on what parameters are available for it are here. iCalUID is not listed. However you can retrieve it with Events.get, it should be included in the response.Paperhanger
Maybe the information that you are looking for is in the body of the event ? It is not transmitted by default (you have to ask for it) Please check the table here: calendar.eventAggrieve

© 2022 - 2024 — McMap. All rights reserved.