1

I am using FileMaker to interact with the Google Calendar API. I have managed to authorize my app, get a list of user's calendars and a list of events in those calendars and details for those events. However, I am having trouble creating events.

I make the following HTTP POST request. Header: Content-Type : application/json, Authorization : Bearer access_token

https://www.googleapis.com/calendar/v3/calendars/**********@gmail.com/events?{"attachments":[{"fileUrl":""}],"attendees":[{"email":"***********@gmail.com"}],"end":{"dateTime":"2017-08-20T13:00:00-05:00"},"reminders":{"useDefault":true},"start":{"dateTime":"2017-08-20T12:00:00-05:00"},"summary":"Test Event"}

I receive the following JSON error response:

{
    "error": 
    {
        "errors": 
            [
                {
                    "domain": "global",
                    "reason": "required",
                    "message": "Missing end time."
                }
            ],
        "code": 400,
        "message": "Missing end time."
    }
}

It appears that this is a pretty common error that people run into. However it looks like most having this problem are using frameworks for which there are libraries that Google Calendar API supports. I've tried to pick out the fix from some of the posts on stackoverflow and elsewhere concerning these other frameworks and apply them to my FileMaker / HTTP GET/POST setup to no avail.

Any help greatly appreciated!

1
  • Did you ever figure this out? I am having the same problem building my own http request. Commented Apr 10, 2018 at 19:41

2 Answers 2

1

Try using this instead.

POST https://www.googleapis.com/calendar/v3/calendars/calendarId/events

And supply the calendarId according to what the parameter requires

Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword.

Sign up to request clarification or add additional context in comments.

1 Comment

I may be missing something, but I believe that is how my HTTP POST was written in my original post. The API doesn't like something about the "Event Resource" that I included in the request body. Do you know what the "Event Resource" / http request body should look like?
0

Use this

curl --location --request POST 'https://www.googleapis.com/calendar/v3/calendars/{email}/events' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {access_token}' \
--header 'Content-Type: text/plain' \
--data-raw '{`enter code here`
  "summary": "Google I/O 2015",
  "location": "800 Howard St., San Francisco, CA 94103",
  "description": "A chance to hear more about Google'\''s developer products.",
  "start": {
    "dateTime": "2015-05-28T09:00:00-07:00",
    "timeZone": "America/Los_Angeles"},
  "end": {
    "dateTime": "2015-05-28T17:00:00-07:00",
    "timeZone": "America/Los_Angeles"
  },
  "recurrence": [
    "RRULE:FREQ=DAILY;COUNT=2"
  ],
  "attendees": [
    {"email": "[email protected]"},
    {"email": "[email protected]"}
  ],
  "reminders": {
    "useDefault": false,
    "overrides": [
      {"method": "email", "minutes": 24},
      {"method": "popup", "minutes": 10}
    ]
  }
}'

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.