Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CalendarApi events.insert not working #565

Closed
awb99 opened this issue May 3, 2016 · 3 comments
Closed

CalendarApi events.insert not working #565

awb99 opened this issue May 3, 2016 · 3 comments
Assignees

Comments

@awb99
Copy link

awb99 commented May 3, 2016

Google calendar.evetns.insert does not work:

calendar.events.insert (
        {
            start: { dateTime: "2016-05-03T18:03:58+02:00" },
            end: { dateTime: "2016-05-03T18:03:58+02:00" },
            calendarId: "uq6d9is81bgl0jbeuamt27br9c@group.calendar.google.com",
            summary: "test Summary"
        }, printResult );

This returns:

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

I tested it via curl, and via curl it works:

curl -X POST -d @data/calendarAdd.json https://www.googleapis.com/calendar/v3/calendars/myemail%40gmail.com/events?access_token=<my token>  --header "Content-Type:application/json"

Strangely enough the quickadd does work

 calendar.events.quickAdd ( {calendarId: "uq6d9is81bgl0jbeuamt27br9c@group.calendar.google.com", text: "20160501 test" }, printResult );

I guess that perhaps "end" is a reserved word?

I have removed the token that I did use.

@awb99
Copy link
Author

awb99 commented May 3, 2016

I solved it.
I think this should be highlighted un the readme..

  calendar.events.insert (
        {
            calendarId: "uq6d9is81bgl0jbeuamt27br9c@group.calendar.google.com",
            resource : {
              start: { dateTime: "2016-05-03T18:03:58+02:00" },
              end: { dateTime: "2016-05-03T18:03:58+02:00" },
              summary: "testSummar"
            }
        }, printResult );

@segreb
Copy link

segreb commented Sep 9, 2017

Probably, the reason of this error not wrong time. Probably, Calendar API can't recognize you json. Header of http-request MUST contain "Content-Type: application/json". See here: https://stackoverflow.com/questions/37535563/missing-end-time-with-google-calendar-and-racket-google-package?rq=1

yoshi-automation added a commit that referenced this issue May 21, 2020
To avoid generating bogus PRs

Co-authored-by: Jeffrey Rennie <rennie@google.com>

Source-Author: Carlos de la Guardia <cguardia@yahoo.com>
Source-Date: Tue May 19 11:57:19 2020 -0500
Source-Repo: googleapis/synthtool
Source-Sha: d2364eb80b840a36136c8ce12f1c6efabcc9600e
Source-Link: googleapis/synthtool@d2364eb
yoshi-automation added a commit that referenced this issue May 22, 2020
To avoid generating bogus PRs

Co-authored-by: Jeffrey Rennie <rennie@google.com>

Source-Author: Carlos de la Guardia <cguardia@yahoo.com>
Source-Date: Tue May 19 11:57:19 2020 -0500
Source-Repo: googleapis/synthtool
Source-Sha: d2364eb80b840a36136c8ce12f1c6efabcc9600e
Source-Link: googleapis/synthtool@d2364eb
yoshi-automation added a commit that referenced this issue May 23, 2020
To avoid generating bogus PRs

Co-authored-by: Jeffrey Rennie <rennie@google.com>

Source-Author: Carlos de la Guardia <cguardia@yahoo.com>
Source-Date: Tue May 19 11:57:19 2020 -0500
Source-Repo: googleapis/synthtool
Source-Sha: d2364eb80b840a36136c8ce12f1c6efabcc9600e
Source-Link: googleapis/synthtool@d2364eb
yoshi-automation added a commit that referenced this issue May 24, 2020
To avoid generating bogus PRs

Co-authored-by: Jeffrey Rennie <rennie@google.com>

Source-Author: Carlos de la Guardia <cguardia@yahoo.com>
Source-Date: Tue May 19 11:57:19 2020 -0500
Source-Repo: googleapis/synthtool
Source-Sha: d2364eb80b840a36136c8ce12f1c6efabcc9600e
Source-Link: googleapis/synthtool@d2364eb
yoshi-automation added a commit that referenced this issue May 24, 2020
To avoid generating bogus PRs

Co-authored-by: Jeffrey Rennie <rennie@google.com>

Source-Author: Carlos de la Guardia <cguardia@yahoo.com>
Source-Date: Tue May 19 11:57:19 2020 -0500
Source-Repo: googleapis/synthtool
Source-Sha: d2364eb80b840a36136c8ce12f1c6efabcc9600e
Source-Link: googleapis/synthtool@d2364eb
@dumkanki
Copy link

End time is provided again giving error
var updatedata = {
"calendarId": data.googleCalendarId,
"resource": {
"end": {
"dateTime": data.endTime,
"timeZone": 'Asia/Dhaka'
},
"start": {
"dateTime": data.startTime,
"timeZone": 'Asia/Dhaka'
},
"sendNotifications": true,
"summary": data.description,
"description": data.description,
"location": data.location,
"attendees": [{
"email": data.email,
"displayName": data.name,
"responseStatus": "needsAction",
"resource": false,
"optional": false,
"organizer": false,
}]
},
}
return function (dispatch) {
return axios
.post(https://www.googleapis.com/calendar/v3/calendars/${data.googleCalendarId}/events?key=${data.apiKey}, { updatedata })
.then(res => {
console.log("nnnnnnnnnnnnnnn", res)
return res;
})
.catch(err => {
toastr.error("Something went wrong, Please try again");
});
}
can someone help me to find solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants