Creating and modifying calendar subscriptions using the google API - calendar

I want the ability to create a calendar using the calendar API and issue one-way syncs to this calendar when changes happen on my end. I do not want the user to be able to make changes, i.e., it should work like a subscription but instead of google pulling changes, I want to push changes. This way users can get the changes in real time as opposed to having to wait for a long time to see updates.
I looked through the APIs and I could find no way to a) create subscription b) force subscribed calendar refresh. I also tried creating a secondary calendar and setting ACLs on it for the current user but this also doesn't work, I get the following error:
"reason": "cannotChangeOwnAcl",
"message": "Cannot change your own access level."
Is there a way to accomplish this with the API?

Related

How to get notification on my server if any event is edited or deleted on user Google calender

After the successful authentication on Google, user get event information
Which is processed on our server.
But if any events edit or delete user is not able to getting update regarding this, user need again call calender api.
How we can get changing update regarding google calendar events on our server without again call of calendar api.
If I understand you correctly, you want to receive a notification to your server whenever a calendar event changes.
If that's the case, consider using push notifications:
First, set up a URL where notifications will be received.
Second, call Events: watch to set up the notification channel.
Take a look at push notifications for a complete guide on this, and Events: watch for documentation on the method you'll have to call after setting up the webhook.

Microsoft graph calendar api delete instance of recurring event

I have created recurring calendar events through graph API in outlook, however, I am not able to find any way to delete a particular instance of a recurring event through Graph API. I have looked all over the graph API documentation
https://learn.microsoft.com/en-us/graph/api/event-delete?view=graph-rest-1.0&tabs=javascript
Let me know is it really possible to update/delete a particular recurring event instance and how.
Thanks!!
You can get all events from the calendar and use the Id of the instance to delete it, a way to get the specific event is by querying the results or you can use the specific endpoint to list instances:
Send a DELETE request using the following path: https://graph.microsoft.com/v1.0/me/events/{id}
I did some tests using the Graph Explorer and worked, you can try there
before start the real development.

Salesforce – Notify external API (or create activity event) on custom object change

I need a fairly trivial thing: every time a user changes a salesoforce custom object field, I need to notify the external service about the change.
Either push the notification or somehow log the object change event somewhere in salesforce. (and make the external service regularly check those latest events for any new activity)
Is either of those options possible?
The only info I could find on this issue is this somewhat relevant SO thread, but it's 3 years old and doesn't answer anything.
This can be done by creating a PushTopic and subscribing to it via Streaming API.

Getting history events for just new messages?

I'd like to monitor a users gmail account for new messages and take an appropriate action. Is there a way to fetch the history events for just new messages but NOT for things like starring an email or changing its labels, etc.?
So I ended up using messages.list and storing the timestamp of the most recent message. Then on subsequent calls to messages.list I'd supply a query of "after:theMostRecentTimestampIKnowOf" to find new messages since the last time we synced.
Another route I've seen done, is if you have the ability to add a filter (e.g. user's can do that, or use the Google Admin SDK for Google Apps users, or do it through HTML/DOM hacking) then you can simply setup a filter to apply a label to all new messages. Then just messages.list(labelId=THAT_LABEL) when you do your polling (and remove it after you process them).
There is not any ability now to filter history based on change type, though it's something that would be nice to provide at some point.

Listening to changes in sling's users and groups

I want to be notified of changes to users or groups in sling's userManager as they happen. For example, when a new group is created, I need to create a new node with the same name under /content. When a new user is created, I want to give them write-permissions for /content/foo. And similar tearDown steps when objects are deleted.
I tried registering a EventHandler (org.osgi.service.event.EventHandler), with event.topics set to "*" (all topics), but this captured only resource changes and not userManager changes because users and groups are synthetic resources (I think)
I tried using a org.apache.sling.api.request.SlingRequestListener, but the SlingRequestEvent did not come with any info that would help me distinguish the request (or I didn't know how). Also, I am not sure if this is can even be used for callbacks that need to be called AFTER the request is processed.
I have used Filters for a different issue and I tried applying them for this purpose too. But they have their limitations - My filter is called BEFORE the request, so it's not possible to know if the request will result in SUCCESS before deciding to take action.
Any suggestions on how to listen and respond to changes in sling's user and group models?
In https://issues.apache.org/jira/browse/SLING-977 Ian Boston suggests using a SlingPostProcessor service to be informed of calls to the user management's POST servlets.
I haven't tried it myself, and if you do it you might anyway miss changes that are done via Sling's user management APIs - but that might be good enough depending on your use case.
Apart from that I don't think there's currently a surefire way of being notified of such changes. To implement that in Sling we'd need to wrap the org.apache.jackrabbit.api.security.user.* objects (Group, User, UserManager) to send events when they're changed. Certainly doable but would require changes to that Sling bundle.

Resources