How do I access the Google Calendar Resource API?

I can only access the Google Calendar API after enabling it in the developer console, as explained in this SO page . However, I cannot find the Google Calendar Resource API in the list for inclusion. Despite this, I tried to access the resource API through OAuth 2.0 , for example, as I access the calendar API, but I get the following error

Exception in callback of async function: Error: failed [403] <HTML> <HEAD> <TITLE>You are not authorized to use this API.</TITLE> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000"> <H1>You are not authorized to use this API.</H1> <H2>Error 403</H2> </BODY> </HTML> 

How do I make it work? If you got it to work, please share!

EDIT: To give more details, I use Meteor JS for POST at the following URL with headers below:

  var xmlContent = "<?xml version='1.0' encoding='utf-8'?>" + "<atom:entry xmlns:atom='http://www.w3.org/2005/Atom' xmlns:apps='http://schemas.google.com/apps/2006'>" + "<apps:property name='resourceId' value='"+ resource._id +"'/>" + "<apps:property name='resourceCommonName' value='"+ resource.resourceName +"'/>" + "<apps:property name='resourceDescription' value='"+ resource.resourceDescription +"'/>" + "<apps:property name='resourceType' value='"+ resource.resourceType +"'/>" + "</atom:entry>"; var url = "https://apps-apis.google.com/a/feeds/calendar/resource/2.0/example.com/"; var id = HTTP.post(url, { 'headers' : { 'Content-Type': 'application/atom+xml', 'Authorization': 'OAuth2 oauth_token=' + admin.services.google.accessToken, 'X-JavaScript-User-Agent': "Google APIs Explorer" }, 'content': xmlContent } , function(error, result) { if (error) throw error; });//end HTTP.post 
+1
source share
1 answer

I can make it work by adding the following to the request:

 headers: { Authorization: 'OAuth2 oauth_token=' + accessToken; } 
0
source

All Articles