This handler uses the Google API library to share a Google Calendar either publicly or privately. The handler first uses the inputted refresh token and client id/secret to authorize the client (instructions on how to get these values can be found below). A call is then made to exchange the Calendar Name for a unique Calendar Id. After retrieving that, another call is made to Google to complete the sharing of the calendar. A list of possible calendar access types can be found below. Any errors that occur during the posting process will be caught and re-raised by this handler.
[none] Provides no access [freeBusyReader] Provides read access to free/busy information [reader] Provides read access to the calendar. Private events appear with details hidden. [writer] Provides read and write access to the calendar. Private events appear with details available. [owner] Provides ownership access to the calendar.
To enable the Calendar API and get Client Id and Client Secret: 1. Navigate to the 'Google Developers Console' 2. Click on the Create Project button (or if you have an existing project that you wish to keep using, click on the project name.) 3. Go to the APIs page and turn on the Calendar service 4. Go to the Credientials page and Create a new Client Id * Select 'Installed Application' for the application type * Select 'Other' for the Installed Application Type To retrieve the Refresh Token for the account you want to post to 1. Put this url into your browser, while substiuting [:clientid] for the client id of your application * https://accounts.google.com/o/oauth2/auth?clientid=[:clientid]&redirecturi=urn:ietf:wg:oauth:2.0:oob&scope=https://www.googleapis.com/auth/calendar&responsetype=code&accesstype=offline
2. Choose or add the account that you wish to connect the handler with 3. Click accept to give your application permission to modify the calendar 4. Copy and paste the success code that appears on the page 5. Send a post request to get the refresh token * This can either done with Curl or with a browser extension like Advanced REST Client in Chrome (A sample curl call is below)
POST URL = https://accounts.google.com/o/oauth2/token POST Parameters: code=[:code]&clientid=[:clientid]&clientsecret=[:clientsecret]&redirecturi=urn:ietf:wg:oauth:2.0:oob&granttype=authorizationcode Sample Curl Call: curl -- data "code=[:code]&clientid=[:clientid]&clientsecret=[:clientsecret]&redirecturi=urn:ietf:wg:oauth:2.0:oob&granttype=authorizationcode" https://accounts.google.com/o/oauth2/token
|Calendar Name||The name of the calendar that will be shared.|
|Sharing Scope||The scope for who the calendar will be shared with. The scope will default to public access, but you can also limit it to user, group, or domain.|
|Recipient||If the scope is not public, the username, group name or domain name for who the calendar will be shared with.|
|Calendar Access||The access type that the recipient will have to the calendar.|
|Calendar Name||Example Calendar|
This handler does not return any results.