Sunday 2 August 2020

Google Calendar API Tutorial #3 | Delete Events | Get Event IDs | 2020




Download VENDOR Folder (Only for PHP version 7.2+): https://unpossiblepog.com/research-and-development/php/Vendor-Folder-For-Google-Sheet-Drive-Calendar-With-PHP-Version-7.2-And-Onward

PHP Google Calendar Delete EVENTS.

Google Calendar PHP Connection:-
https://youtu.be/Q-498CAa1xE

Google Update Alert :-
https://youtu.be/5COjnEc4d9E

Delete event Code Link:-
https://developers.google.com/calendar/v3/reference/events/delete

Subscribe my Channel:-
http://www.youtube.com/user/SanketRooney?sub_confirmation=1

Facebook Page:-
https://www.facebook.com/UnpossibleNS

Twitter Account:-
https://twitter.com/UnpossiblePOG

Blog :-
https://unpossiblepog.blogspot.in/
------------------------------------------------

Hey guys.
In this tutorial, we shall delete google event using PHP code.
For that, you must first connect PHP with google calendar which are shown in those tutorials.
Both of those links are given in the description.
Now, if you are able to display or add events, you can continue watching further.
I gave a link in the description for a code for deleting event.
In that function, first argument is calendar ID and second is event id.
To find calendar ID, follow my steps.
You will find calendar ID here, which I am already using in code.
Now, we can get the event ID in two ways.
1, while adding a new event. And 2nd by getting events list from LOOPS.
1st, I shall comment the loop code, and add the event.
Here, use getID function.
Lets run the code.
We do get the ID, but ignore the “slash N”, which I accidentally printed in code.
You can store that ID in database or session or anywhere for later use.
Comment that ADD-EVENT code.
Now we shall just copy that in our code directly.
Now we use that provided code.
And use calendar ID and event ID.
As you can see, the event was added by the code is here.
If we refresh, it will be vanished as you can see.

However what if you don’t have event ID, so for that, enable the DISPLAY EVENT code.
& use that delete function here.
Lets create some events manually.
Notice that the third event is from different calendar which will not be delete as it belongs to different calendar.
Now they are vanished like a magic.
Code link & other required links are given in the description.
Don’t forget to like, share and subscribe.
Thanks for watching. 

No comments:

Post a Comment