chintanparikh
chintanparikh

Reputation: 1682

Google Calendar API returns a 404 when trying to get all my calendar events

I'm trying to log all my events to the console. Should be fairly simple, but it can't find my calendar for some reason (the id is definitely correct, and my API key isn't blank in my actual code.

<html>
<head>
    <title>Google Calendar Example</title>
    <script src="client.js"></script>
    <script>
        var apiKey = '';

        function load()
        {
            gapi.client.setApiKey(apiKey);
            gapi.client.load('calendar', 'v3', function()
                {
                    var request = gapi.client.calendar.events.list({
                        'calendarId': '[email protected]'
                    });

                    request.execute(function(resp)
                    {
                        console.log(resp);
                    });
                });
        }
    </script>
</head>
<body>


</body>
</html>

The response:

Object {code: 404, message: "Not Found", data: Array[1], error: Object}

Any idea what's wrong?

Upvotes: 5

Views: 4870

Answers (1)

pinoyyid
pinoyyid

Reputation: 22306

Your calendar ID is incorrect. It should look something like [email protected]

Upvotes: 2

Related Questions