If you list Google Calendar events using this API or particular event using this API specifying Calendar Resource room ID instead of calendar ID, you get list of all events associated to that Calendar Resource.
If you then want to delete or modify that event using domain-wide delegation of authority you can get event owner form creator.email field.
The question is how to get calendar ID where the event is created to be able to delete or modify it?
Of course you can try to use creator's e-mail or primary for the calendar ID but this fails if the user created the event in any other than default calendar.
Related
I want to create event via google calendar api using Go. I found out that the sender (From) is whoever responsible in client_id I provide in the google API, in this case me. Can I edit this sender, so that it is not sent from me? At least I can edit the display name of the sender, the email I think will always be my email
Also about editing the organizer, I tried to use move action but it only moves the event, not change the organizer. Is there other way to edit organizer?
To address your questions:
1. Can I create an event from another address?
What you want can be done by creating a service account and performing domain-wide-delegation
What is a service account?
A service account is a special type of Google account intended to represent a non-human user that needs to authenticate and be authorized to access data in Google APIs - in your situation the Calendar API.
After creating the above mentioned service account, you will have to perform domain-wide-delegation and impersonate a user in your domain in order to be able to create the event wanted.
Now, when writing the code for your application, you will have the use the credentials that were created for this account in order to authorize the requests.
OR
If you want to specifically edit only the display name of the creator of the event, you can perform an update request:
PUT https://www.googleapis.com/calendar/v3/calendars/calendarId/events/eventId
And add in the request body this:
"creator": {
"displayName": "UPDATED DISPLAY NAME"
}
2. Can I edit the organizer?
According to the Calendar API Documentation:
organizer > The organizer of the event. If the organizer is also an attendee, this is indicated with a separate entry in attendees with the organizer field set to True. To change the organizer, use the move operation. Read-only, except when importing an event.
Therefore, the organizer can be changed/updated only when importing the event in question.
Reference
Authorizing Requests to the Google Calendar API
;
Creating A Service Account;
Calendar API Events Resource;
Calendar API Events:Update.
Background
I'm trying to create an appointment calendar using GSuite and Google Calendar API. When a user (no Google account and outside the GSuite organization) creates an appointment, I'm trying to create a Calendar event on the Calendar of an organization member via the Google Calendar API and generate a Hangouts meeting link.
Problem
I can create the event and the Hangouts meeting link, but I cannot create a custom label for the video link. I was able to make it slightly unique by adding an attendee with a fake email xczczf#example.com to John Doe's calendar to get a label of doe-j-xcz, but I would like full control over the label if possible.
Attempted Solutions That Didn't Work
Create the event and provide a conferenceData.createRequest and an entryPoint with the desired label.
Create the event first and then send a patch with the information described in 1
Changing the conferenceId
After messing around with the API Explorer, a custom label can be made by:
Creating the Cal event and adding a meeting link using a createRequest
Send a Patch with conferenceData.conferenceId set to the unique label value
Hi I am creating an event using service account and added attendees. The response returned correctly but attendees are not getting invite mails. The Service account is not linked (shared) with any google account. Though to login into API console I used my gmail account. Calendar Id was given as Primary. Where the event will get created, on Service account's Calendar or my primary Calendar?. I could not see it on mine Calendar but response returned with Status "Confirmed". I am more interested in invites rather where the original event got created.
Any help would be appreciated !!!
You need to remember that a service account is not you. Think of a service account as a dummy user. It has its own calendar account, drive account and probably a bunch more. When you inserted an event into primary you inserted it into the service accounts primary calendar.
You have a few options.
Share your primary calendar with the service account. Just add it as a user. Find the calendar id in the settings and have the service account insert into that calendar id.
Have the service account share its primary calendar with you by granting you permissions to it. you should then be able to see it on the bottom left hand side of the Google calendar website.
Have the service account invite you to the event on the service accounts Google calendar.
Have the service account create the event with you as an attendee event.insert check the body of the request.
in my windows phone application
when i was try use Google Calendar API insert a CalendarList as Fllow link: https://developers.google.com/google-apps/calendar/v3/reference/calendarList/insert
about reqeust it was need a calendar id. when i insert some format string . it was tip some reaource can't be found.
how to define a google calendar id in my windows phone application? or
is there have some interface automatically generated?
any suggestion?
The Calendar ID refers to the particular calendar you are trying to access. For any primary calendar, it will be your email address. For secondary calendar, you can find the Calendar ID in the Calendar setting. Under Calendar details, you will see a the Calendar address where the Calendar ID is located.
I'm attempting to use VBA to access the Google Calendar API V3. I can't figure out how to determine which calendar a new event should be written to by default. Is there no such thing as a default or primary calendar under V3 of the Google Calendar API?
Will the CalendarID for the default calendar always be the user's email address?
To answer your question, no, the email address is not the default CalendarID. You can user "primary" as the default CalendarID. If you want, you can get a list of all the user's Calendar ID's and even create/delete calendars. Check out https://developers.google.com/google-apps/calendar/v3/reference/calendarList
you can just use the string "primary" for the CalendarID property to get the default calendar