How to create an event in a user's Google Calendar that can not be modified? - calendar

I want to create an event in a user's Google Calendar that can't be modified by that user.
In the following example, the API belongs to a#gmail.com, and is used to put an event in the calendar of b#occsn.com. To create an event that might be locked, I use the import interface from Google's API
start:
datetime: <date + time>
end:
datetime: <date + time>
summary: My Awesome Event
i_cal_uid: <random UUID>
organizer:
email: noreply#example.com # Non-existent address
display_name: MyAwesomeCompany
attendees:
-
email: <target calendar ID, e.g. user.com_q23rlj3we#group.calendar.google.com>
response_status: accepted
This creates an event on the user's calendar. If the user sees it in his calendar app (I use Fantastical), it can't be moved, but if user goes to Google Calendar's web site directly, the event can be moved, and it warns – only once – about "only moving it in Target Calendar" or something.
My question: Is it possible to create an event in the user's calendar that the user can not modify or move at all?

Related

Trigger action without user utterance

I want to write a Google Home action that tells the latest value of a field in a DB table. (Another service will keep updating the DB.)
How do I make Google Home speak the update automatically every 10 seconds without further user utterance after the Action is launched?
Interaction would be like this:
User: "OK Google, start Progress Updater"
Google Home: (Every X seconds) "10 percent."
Google Home: "19 percent"
...
Google Home: "100 percent."
Google Home: *"Task is complete!"
End of interaction
I know how to do it if a user has to say every time "Google Home, get me update".
Is there a way to do it in an automatic loop?
Tried following code based on response from #Prisoner
conv.ask(new MediaObject({
name: 'Jazz in Paris',
url: 'https://storage.googleapis.com/automotive-media/Jazz_In_Paris.mp3',
description: 'A funky Jazz tune',
icon: new Image({
url: 'https://storage.googleapis.com/automotive-media/album_art.jpg',
alt: 'Media icon',
}),
}));
});
The best tool that we have to do this is the Media prompt.
Under this scheme, when you return any progress except for "complete", you'll include a Media object with a 10 second audio. When the audio finishes playing, you'll get a MEDIA_STATUS result, indicating the audio has finished. You can then check the status and reply accordingly, possibly including another Media in your prompt.

How do I register a Go To Webinar attendee to a specific session using their API V2?

OK so...through a custom form, I am successfully registering attendees to Go To Webinar but am blocked if there are multiple sessions of the same webinar. Currently, I am returning scheduled sessions to populate our dropdown menu (response shown below) but am challenged with passing back sessionKey with the registration payload. Has anyone successfully done this? Help! I've also put in an inquiry with GTW so will let folks know what I hear if others are struggling with this also. Thanks!
[{
webinarKey: xxxxxxxxxxxxxxxxx,
registrantsAttended: 0,
webinarID: "xxxxxxx",
sessionKey: 666666,
startTime: "2020-05-06T19:27:54Z",
endTime: "2020-05-06T20:01:13Z"
},
{
webinarKey: xxxxxxxxxxxxxxxxx,
registrantsAttended: 0,
webinarID: "xxxxxxx",
sessionKey: 777777,
startTime: "2020-05-07T19:26:08Z",
endTime: "2020-05-07T19:26:43Z"
}]
Populate a list for the webpage visitor using Scheduled
webinars
An interested individual selects a webinar from the list
and you submit their details using Create registrant
For step 2 you should also know the following:
To use the second version of the api you must pass the header value
'Accept: application/vnd.citrix.g2wapi-v1.1+json'
instead of 'Accept: application/json'.
Leaving this header out results in the first version of the API call.

Delete / Clear all events that created by Google Calendar API

I have an application using Google Calendar API.
private function getClient() {
$client = new \Google_Client();
$client->useApplicationDefaultCredentials();
$client->setScopes('primary');
return $client;
}
Credential is a service_account.
I created and inserted about 65000 events by the above client.
Now, I want to deleted all events (65000 events).
I want to use /clear (
https://developers.google.com/google-apps/calendar/v3/reference/calendars/clear) API to do that but I am not sure it will delete all events from my application without clear other events on my calendar.
I mean on my calendar there are 2 type of events:
Personal Event, created by Rakumo calendar
Event from my application.
I just want to delete all events created from 2.
Anybody can confirm when use /clear API
$service->calendars->clear('primary');
will it delete only all events created from my application ?

How to update ICS calendar meeting?

I am trying to generate .ics files which I want to send as attachments to customers. For some reason, if meeting is rescheduled, it is not updated neither in google calendar nor in Calendar app on mac OS.
Here is a meeting.ics with SEQUENCE:1:
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//example.com//Appointment v1.0//EN
METHOD:REQUEST
BEGIN:VEVENT
UID:citfslfcd0001hx61sjcqqp4q
SEQUENCE:1
DTSTAMP:20160923T151743
DTSTART:20160923T211500
ATTENDEE:;CN="user1";RSVP=FALSE:mailto:user1#example.com
ATTENDEE:;CN="user2";RSVP=FALSE:mailto:user2#example.com
LOCATION:Sweden
DESCRIPTION:Meeting
SUMMARY:Meeting
CLASS:CONFIDENTIAL
CATEGORIES:BUSINESS
END:VEVENT
END:VCALENDAR
And here updated meeting with SEQUENCE:2 and DTSTART one day later:
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//example.com//Appointment v1.0//EN
METHOD:REQUEST
BEGIN:VEVENT
UID:citfslfcd0001hx61sjcqqp4q
SEQUENCE:2
DTSTAMP:20160923T161267
DTSTART:20160924T211500
ATTENDEE:;CN="user1";RSVP=FALSE:mailto:user1#example.com
ATTENDEE:;CN="user2";RSVP=FALSE:mailto:user2#example.com
LOCATION:Sweden
DESCRIPTION:Meeting
SUMMARY:Meeting
CLASS:CONFIDENTIAL
CATEGORIES:BUSINESS
END:VEVENT
END:VCALENDAR
When I open first file in google calendar (from email attachment) or Calendar app on Mac meeting is added to calendar as expected.
When I open second file in google calendar then duplicate meeting with new meeting date is created.
When I open second file in Calendar app then... nothing happens - first meeting just "bounces" in date cell, but nothing happens...
What might be wrong with those ics files?
I also can't cancel meeting despite gmail recognizes it (the .ics attachment) and shows message "This meeting has been canceled".
Here is a screenshot of what happens when I try to update event:
And here what gmail show when I try to cancel the meeting (It shows "Meeting has been canceled" in Polish) (but event is not removed / updated in google calendar):
Your ATTENDEE properties look wrong. The colon character that is after the property name should not be there due to the fact that the property has parameters.
For example this:
ATTENDEE:;CN="user1";RSVP=FALSE:mailto:user1#example.com
should be this:
ATTENDEE;CN="user1";RSVP=FALSE:mailto:user1#example.com
In fact, your ATTENDEE property needs more arguments to make sure Google Calendar considers it an update:
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-
ACTION;RSVP=TRUE;CN=Recipient Name;X-NUM-UESTS=0:mailto:recipient#gmail.com
I have provided a more complete explanation here: https://stackoverflow.com/a/49585109/5669260

Salesforce Tooling API - Deactivate Trigger

I am attempting to deactivate triggers using the tooling API. I have successfully in a developer ORG. But was unable to do this in a real developer org. Is this a Salesforce tooling api bug?
Here is the basis of the algorithm,
Create a MetadataContainer with a unique Name
save MetadataContainer
Create an ApexTriggerMember setting the Body, MetadataContainerId, ContentEntityId, and Metadata[apiVersion=33.0 packageVersions=[] status="Inactive" urls=nil>]
Modify Metadata["status"]="Inactive"
save ApexTriggerMember
Create/Save ContainerAsyncRequest
monitor container until completed.
display errors if appropriate
In the sandbox, I have confirmed after requerying the Apex enter code hereTriggerMember that the read-only field "Content" looks appropriate. I also confirmed that the MetadataContainerId now points to a ContainerAsyncRequest that has a State of "Completed"
Here are my results, it appears to be a success, but the ApexTrigger is never deactivated
ContentEntityId = 01q.............[The ApexTrigger I want deactivated]
Content="<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<ApexTrigger xmlns=\"urn:metadata.tooling.soap.sforce.com\">
<apiVersion>33.0</apiVersion>
<status>Inactive</status>
</ApexTrigger>"
Metadata={apiVersion=33.0 packageVersions=nil status="Inactive" urls=nil> attributes= {type="ApexTriggerMember"
url="/services/data/v33.0/tooling/sobjects/ ApexTriggerMember/401L0000000DCI8IAO"
}
}
I think you need to deploy the inactive Trigger from Sandbox to Production. You can't simply deactivate the Trigger in Production. This is true even in the UI.
There are other options, such as using a Custom Setting or Metadata Type to store a Run/Don't Run value. You would query that value in the Trigger to decide whether or not to run it.
https://developer.salesforce.com/forums/?id=906F0000000MJM9IAO

Resources