javascript - gapi.client.load() results 404 Error for google calendar v3 -


code -

var request = gapi.client.calendar.events.insert({         'calendarid': 'primary',         'resource': event     });  request.execute(function(event) {   console.log('event created: ' + event.htmllink); }); 

and gives url follow

https://content.googleapis.com/calendar/v3/calendars/primary/events?alt=json&key=aizasyaqwdnncpsjnnazo5bq8tmiszvzr1yarao

i couldn't find reason. problem in api key or else?

oops! sorry have found solution of problem. event object sending calendar wrong. working fine.it silly mistake of mine.this total code , working fine me.......

var client_id = 'myclientid'; var scopes = ["https://www.googleapis.com/auth/calendar"]; var evntjsn = '';  function addeventingoogle(eventlist){     evntjsn = eventlist;     var apikey = 'myapikey';     gapi.client.setapikey(apikey);      gapi.auth.authorize(       {         'client_id': client_id,         'scope': scopes.join(' '),         'immediate': true       }, handleauthresult); }  /** * handle response authorization server. * * @param {object} authresult authorization result. */  function handleauthresult(authresult){     if (authresult && !authresult.error) {       loadcalendarapi();     } else {      handleauthclick(event);     } }  /** * initiate auth flow in response user clicking authorize button. * * @param {event} event button click event. */  function handleauthclick(event) {     gapi.auth.authorize(     {         client_id: client_id,         scope: scopes,         immediate: false     },     handleauthresult);     return false; }  function loadcalendarapi() {     gapi.client.load('calendar', 'v3', addeventtogglcalendar); }  function addeventtogglcalendar(){     var event = evntjsn;     var request = gapi.client.calendar.events.insert({         'calendarid': 'primary',         'resource': event     });      request.execute(function(event) {       console.log(event);     }); } 

Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -