Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7787425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:39:52+00:00 2026-06-01T20:39:52+00:00

I’m trying to add an event to a Google Calendar using the Google API

  • 0

I’m trying to add an event to a Google Calendar using the Google API V3. I’m not using any of Google’s libraries so I’m really baffled as to how to do this. Google’s documentation tells me that I need to send an “Events Resource” in the request body. I think I’ve built a valid JSON “string” but I have no idea how to properly prepare it and send it in the so-called “request body”. What confuses me is the way that string values are wrapped in quotes and non-string values are not. Does this mean that I’ll need to wrap the entire thing as a string and double/quadruple quote each double quote?

Here’s the JSON I’ve written but I haven’t figure out yet how to pass this to Google so I haven’t been able to test it:

{
  "kind": "calendar#event",
  "start": {
    "dateTime": 04/10/2012 08:00 AM
  },
  "end": {
    "dateTime": 04/10/2012 08:00 AM
  },
  "attendees": [
    {
      "email": "myemailaddress@gmail.com",
      "displayName": "My Name",
      "organizer": True,
      "self": True
    }
  ],
  "reminders": {
    "useDefault": True
  }
}

I do have a VBJSON code module installed in my Access/VBA Database. I see a function in there called StringToJSON which returns a string. I’m still baffled. When I pass this JSON to Google, will it merely be one big string value within my code?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:39:55+00:00Added an answer on June 1, 2026 at 8:39 pm

    OK, so I finally figured out how to build and pass my JSON string. I’m using VBJSON to build the JSON string. Please remember that JSON is case sensitive (or at least Google interprets it case sensitive). A pair with the key dateTime is not the same as a pair with the key datetime and Google will reject the latter.

    'Code to create JSON using Dictionary Objects and Collection Objects
    Dim d As New Scripting.Dictionary
    Dim c As New Collection
    
    d.Add "kind", "calendar#event"
    d.Add "summary", "Event Title/Summary"
    
    Dim d2(4) As New Scripting.Dictionary
    
    d2(0).Add "dateTime", "2012-04-14T16:00:00.000-04:00"
    d.Add "start", d2(0)
    
    d2(1).Add "dateTime", "2012-04-14T18:00:00.000-04:00"
    d.Add "end", d2(1)
    
    'First Attendee
    d2(2).Add "email", "john.doe@gmail.com"
    d2(2).Add "displayName", "John Doe"
    d2(2).Add "organizer", True
    d2(2).Add "self", True
    'Add attendee to collection
    c.Add d2(2)
    
    'Second attendee
    d2(3).Add "email", "suzy.doe@gmail.com"
    d2(3).Add "displayName", "Suzy Doe"
    'Add attendee to collection
    c.Add d2(3)
    
    'Add collection to original/primary dictionary object
    d.Add "attendees", c
    
    'Add more nested pairs to original/primary dictionary object
    d2(4).Add "useDefault", True
    d.Add "reminders", d2(4)
    
    'Now output the JSON/results
    'This requires the VBJSON module (named just JSON, a module, not a class module)
    Debug.Print JSON.JSONToString(d)
    

    The unprettified output is this:

    {"kind":"calendar#event","summary":"Event Title\/Summary","start":{"dateTime":"2012-04-14T16:00:00.000-04:00"},"end":{"dateTime":"2012-04-14T18:00:00.000-04:00"},"attendees":[{"email":"john.doe@gmail.com","displayName":"John Doe","organizer":true,"self":true},{"email":"suzy.doe@gmail.com","displayName":"Suzy Doe"}],"reminders":{"useDefault":true}}
    

    And then here’s how you submit it to Google using V3 of the Google Calendar API. In V3 you have to use OAuth2.0 so you need to have a valid Access Token to append to your URL as shown below. You’ll also need to know your CalendarID which is usually your email address URL encoded. For example, your calendarid will look like this: john.doe%40gmail.com

    Dim objXMLHTTP As MSXML2.ServerXMLHTTP
    Set objXMLHTTP = New MSXML2.ServerXMLHTTP
    Dim sPostData As String
    sPostData = JSON.JSONToString(d)
    
    Dim sURL As String
    sURL = "https://www.googleapis.com/calendar/v3/calendars/{mycalendarid}/events?sendNotifications=false&fields=etag%2ChtmlLink%2Cid&pp=1&access_token={my oauth2.0 access token}"
    
    With objXMLHTTP
        .Open "POST", sURL, False
        .setRequestHeader "Content-Type", "application/json"
        .Send (sPostData)
    End With
    
    Debug.Print objXMLHTTP.ResponseText
    
    Set objXMLHTTP = Nothing
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.