Google Calendar API v3 Returns "Not Found" on event update

Ok first, if this question has been answered, just point me in the right direction. I have searched and searched without being able to find the answer to what I am running into.

Here's the scenario, I have an application that should be able to do the following:

  • Get the list of events for the specified calendar
  • Determine start and end times for events
  • If the start time is wrong (i.e. we created events at 6:01 am instead of 6:00 am), it needs to adjust the start time
  • Submit a POST request to update the start and end times.

So far I have run 1-3 without issue, my problem is number 4. I have a list of events, I changed the time and created a post request, however it always comes back with "Not Found" and I am completely confused.

Here is part of the response that I get back when I request a list of events:

[1] => stdClass Object
    (
        [kind] => calendar#event
        [etag] => "ZrhdJMCgpoUK_a5fT7XOC6xn46g/Z2NhbDAwMDAxMzU4NjE3MzM1NDE1MDAw"
        [id] => dbqcfrdvkm40tnuvbk46mv1ktg
        [status] => confirmed
        [htmlLink] => ########################
        [created] => 2013-01-19T17:42:15.000Z
        [updated] => 2013-01-19T17:42:15.415Z
        [summary] => #########################
        [description] => ########################
        [location] => Traverse City, MI
        [creator] => stdClass Object
            (
                [email] => ######################
            )

        [organizer] => stdClass Object
            (
                [email] => ##################################
                [displayName] => Kent County
                [self] => 1
            )

        [start] => stdClass Object
            (
                [dateTime] => 2013-01-19T13:01:00-05:00
                [timeZone] => America/New_York
            )

        [end] => stdClass Object
            (
                [dateTime] => 2013-01-19T16:01:00-05:00
                [timeZone] => America/New_York
            )

        [recurrence] => Array
            (
                [0] => RRULE:FREQ=WEEKLY;UNTIL=20130331T000000Z
            )

        [iCalUID] => ###############################
        [sequence] => 0
        [attendees] => Array
            (
                [0] => stdClass Object
                    (
                        [email] => ####################
                        [displayName] => ##############
                        [responseStatus] => needsAction
                    )

            )

        [reminders] => stdClass Object
            (
                [useDefault] => 1
            )

    )

      

as you can see I get the event id with no problem, then wrap around and create a post request using the calendar id and the event id I just got

https://www.googleapis.com/calendar/v3/calendars/{CALENDAR ID}/events/dbqcfrdvkm40tnuvbk46mv1ktg?key={API KEY}

      

and this is where I am stuck, the only response I get is "Not Found" even though the headers sent with the request look fine

Array
(
[url] => https://www.googleapis.com/calendar/v3/calendars/{CALENDAR ID}/events/dbqcfrdvkm40tnuvbk46mv1ktg?key={API KEY}
[content_type] => text/html; charset=UTF-8
[http_code] => 404
[header_size] => 360
[request_size] => 485
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0.364634
[namelookup_time] => 3.0E-5
[connect_time] => 0.08616
[pretransfer_time] => 1.7E-5
[size_upload] => 105
[size_download] => 9
[speed_download] => 24
[speed_upload] => 287
[download_content_length] => -1
[upload_content_length] => 105
[starttransfer_time] => 0.3646
[redirect_time] => 0
[certinfo] => Array
    (
    )

[redirect_url] => 
[request_header] => POST /calendar/v3/calendars/{CALENDAR ID}/events/dbqcfrdvkm40tnuvbk46mv1ktg?key={API KEY} HTTP/1.1
Host: www.googleapis.com
Accept: */*
Content-Type: application/json
Authorization: Bearer {SECURITY TOKEN}, X-JavascriptUser-Agent: HiddenOnes
Content-Length: 105
)

      

If I went to the Google Dev Center and used the Events: update test area, this is the url that generated:

https://www.googleapis.com/calendar/v3/calendars/{CALENDAR ID}/events/dbqcfrdvkm40tnuvbk46mv1ktg?key={YOUR_API_KEY}

      

And if I test it from there, it works great, so I'm completely stumped right now, so any helpful, helpful ideas would be welcome.

+3


source to share


1 answer


I would argue that your {CALENDAR ID} is invalid. Where do you get this value from?

It is also possible to use the "primary" calendar identifier, which by default matches the user's primary calendar.



Also, when updating an event, you must use the PUT

HTTP verb https://developers.google.com/google-apps/calendar/v3/reference/events/update

+2


source







All Articles