Has anyone managed to get JSONDerulo working with Google Calendar?

I’ve been trying to see whether JSONDerulo can pull in events from a Google Calendar. It’s supposed to be able to but documentation is pretty light on the Google Cloud configuration aspects needed.

So far I…

And yet I get “No events”. And JSONDerulo doesn’t log anything so there’s no obvious way to see what’s wrong.

Anyone had any joy?

Hej @channel27,
i setup this for years and its still working now. Can you post your Snippet call?

This is mine:

&apiKey=`****SyAqXzqSDHLUPD0gDsdTSPpQP4ICkJlMz3*`  ]]

Here’s mine.

[[!JSONDerulo? &feed=`googlecalendar` 
   &random=`0` ]]

You know, my hunch is that the snippet is fine but there’s a problem with getting the data out of Google Cloud. But there’s no error log entries so rather flying blind.

Hej @channel27,
the Snippet try to fetch this URL. Can you replace the Placeholders with your credentials und test the result in the Browser?


Should look like this:


Here is my result:

In this Google Cloud Console i add the following to the API Key:

This is my working Snippet call for the test:

	&apiKey=`*****8vMh3mwG6TSvV1Iy6ZwPHSpX58` ]]

We’re getting somewhere - thank you.

The direct call by itself only returns events from 2014 (when the calendar was first created). After some tweaking I found that removing the limit in the snippet rendered 10 upcoming items. Thus the snippet became boiled right down to:

[[!JSONDerulo? &feed=`googlecalendar` &tpl=`jd.googleCalendar` &limit=`` &cacheTime=`5` &cacheName=`c27_sched` &feedLocation=`⬛@group.calendar.google.com` &apiKey=`⬛`]]

The problem then comes up that if you want say a week’s worth of events, you’d probably want to set the limit to 30 or something and if you set that, you’ll get nothing back. It looks like the ‘timeMin’ which is supposed to default to NOW isn’t actually doing so. Because if you make a direct call to…


…you get a plausible set of results back

@channel27 you could change the URL in the Snippet a this line (make a copy first :wink: ) and change the date part?

JSONDerulo/v2/snippet.JSONDerulo.php at b302ca1f11afb410f9166abb63f6b71c2ca33988 · pdincubus/JSONDerulo · GitHub

Or maybe you can skip JSONDerulo completely (because its no longer maintained) and make a custom snippet by using for example something like this:

# vars
$pdo = $modx->getService('pdoTools');
$apiUrl = "{apiUrl}";
$lifetime = 60 * 60;
$chunkName = "calendarItem";
$cacheKey = "calendar";
$output = $modx->cacheManager->get($cacheKey);

if (!$output) {
  $data = file_get_contents($apiUrl);
  $json = json_decode($data, true);
  foreach ($json["items"] as $item) {
      $output .= $pdo->getChunk($chunkName, $item);
  $modx->cacheManager->set($cacheKey, $output, $lifetime);

return $output;