EWS - OnNotificationEvent => which fields were modified? - exchangewebservices

I'm getting streaming notifications from folder: 'Calendar' by using the EWS Managed API.
I have subscribed to EventTypes: Created, Moved, Modified, and Deleted.
When I get a notification where the EventType = Modified, I can read values like ItemId and ChangeKey.
My question: Is it possible to find out which fields were modified?
Or can I somehow get the previous version of the calendar item (before modified)?
Any suggestions appreciated.

No its expected in the instance that you are synchronizing changes that you would have a local version to compare any changes against. On Exchange under the recoverableItems Non_IPM_Subtree folder there is Calendar Logging folder that does store information about changes made to the calendar items but this is meant for Calendar repair/diagnostics rather then synchronization.

Related

How to not detect opening of files and folders in google drive changes api

I am building an expressjs application using the google drive api that notifies the user whenever there is a file change in their google drive through webhooks. However, i am also receiving webhooks when i open/view a folder or a file, which is completely unnecessary. Is it possible to only receive webhooks whenever a new file is created or deleted in the drive? And if so, how do i do it?
There is no direct way unfortunately.
You will likely have to make another request once your app has been notified of a change. Its possible you may have to persist some data to compare with depending on what you need to do exactly. The watch endpoint, as you have seen, will notify you of almost every change, including views. So you'll need to find a way to filter these out.
If you are trying to get create/deleted times only then I would suggest taking the file id from the change notification and making a request to get the file metadata and seeing if the file was created in the last 5 minutes (or less) for example. You can speed this up by only getting the createdTime field for instance.
For deleted, you can either get the type of change directly from the change notification, but this will only notify you if you have deleted it permanently i.e. not in the trash. Trash events look just the same as the others. If you need trash notifications, it is going to be more complicated. There is a trashed attribute, but not a timestamp for it. If you need this then you will probably have to keep a snapshot of which files are trashed and then every time you get a request, check to see if the file that changed is now trashed.
There is an active feature request for this
Support event type filtering for Changes watch channel
Go and give it a ☆ to let Google know that you want this feature!

Export the join date for members in a group

Is it possible to export a member's join date to a google group? When you manually export a .csv from a group it gives information on the join date. However, in google app script, I don't see the option for this in the Groups Service. This is the information that is in the .csv:
Any help or resources would be appreciated!
Short answer:
No, you cannot do that programmatically.
Long answer:
Google Groups functionality is mainly handled by Directory API, in its Groups and Members resources. That's what the Apps Script Groups Service is using behind the scenes, and you could use its methods directly by enabling the Admin SDK Directory Service in your script (the APIs —and, as a result, the advanced services— usually have greater functionalities than the Apps Script built-in classes).
If you look at the properties of any of these resources (Groups and Members), you won't find anything close to a join date property, so it doesn't seem to be part of the open API, and can only be accessed through the UI.
The same can be said of Groups Settings API, which can be used to manage group settings: no join date can be found in its resources.
Because of this, you have no way to programmatically store and retrieve the group member's join dates.
Workaround (of a sort):
If you are adding members to a group programmatically, with the API method Members: insert, you could make your application store the date in which each member was added, and retrieve it later. This is not possible, though, if members are added through the UI.
Filing a Feature Request:
Since this resource does seem to exist already (it can be accessed through the UI), I'd suggest you to file a feature request in this Issue Tracker component to make this available to the API. If you do that, please make sure that you explain the usefulness of this functionality (explain how this could help you and, potentially, other users).
Reference:
Directory API: Groups
Directory API: Members
Directory API: Manage Groups

Forge API: Get all changed items

I need to get a list of all changed items in my project in BIM 360. Can I do this using forge-api.
Ho, regarding with the latest question [If my service is not available and I will miss some webhook events, how can I get all the changes that were made after the last webhook event received] :
If your requirement is to know which items are changed in one folder of Docs, Search API with filter can be of use. e.g. the endpoint below will return all items which are updated since a certain time.
https://developer.api.autodesk.com/data/v1/projects/{{project_id_with_b}}/folders/{{one_folder_id}}/search?filter[attributes.lastModifiedTime]-ge=2019-10-15
More filters options are described at
https://forge.autodesk.com/en/docs/data/v2/developers_guide/filtering/
While if you wanted to know all updates in one call, I do not see currently the way is available. While, Activity API is on the way, it might be helpful to know all activities during a certain dates, then you could filter out what you are interested in and locate the corresponding module>>files/resources etc.. but Activities may probably be categorized with specific scopes e.g. admin activities, project actives, issue activities etc. so it is not one call knows all updates.. And these APIs may not be exposed in the same time.

Create a dynamic ICS file that users can subscribe to

We have a website that users login to, and can then book on to courses. These courses and the bookings are stored in our SQL database against the user's UserID. On the course page the user is able to add the course to their Outlook calendar via a simple ICS file that is generated when the user clicks on the button to add it by submitted the required data into the ICS file within the URL that calls it and then using <%=Request("CourseName")%> in the ICS file itself.
We are now looking to create a new ICS file that a user can subscribe to that will update their Outlook calendar with all of the courses they have signed up for, and will automatically update if/when a course has a change applied to it or if the user signs up to a new course then this will also automatically be added to their calendar. I can work out how to generate an ICS file that will hold all of this data using a similar setup to what I have done for the individual courses above, but I cannot work out how to create an ICS file that automatically updates with new information.
I don't know if I need to;
1. Have a hardcoded ICS file stored on the server for each individual user that is then updated as and when a change is made (I would prefer to avoid this as we have a lot of users)
2. If there is a way I can include a SQL statement within an ICS file that will then get the latest course data for the user on the fly (this is preferred, but testing this option so far has always resulted in errors)
3. Something else I have not thought of yet
Any help would be appreciated on this!
Here is the approach we are using to solve a similar problem:
Every time an admin changes an event or a user changes their subscription, we trigger an API call to do two things: (1) notify the relevant users of the changes using an auto-generated iCalendar event (.ics), and (2) update the database with the changes.
We opted to give the users and the administrators the power to trigger event-changes, rather than have a timer that checks and sends out updates, because we wanted to avoid the lag.
As to your question about auto-generating, this requires you to create an event_id, which you re-use in the .ics file, along with a METHOD:REQUEST, which notifies the user's email that you are sending a: (a) new event, or (b) change to a prior event. If you build a dynamic iCalendar script, this is possible. You must capture the "changes" and flow them through to a new .ics request.

Get list of deleted onenote notebooks/sections/pages

My appplication periodically sync data with Onenote. If some content is deleted after syncing for the first how I can get list of names of pages/sections/notebooks that are deleted. Currently I am comparing id's of pages/sections/notebooks that are present in my system and one the which I receive from onenote syncing everytime. But this process takes too long and specially if I have large data.
Is there any MS-Graph/OneNote API which can provide me list(id's) of these deleted entities ?
There's no API to retrieve the list of deleted entities, unfortunately. The best way you can achieve this today with the API is to set up webhook integration, keep state on your side and the querying when you receive a webhook notification saying something changed - it looks like you're doing something similar.
If you believe the API should have this functionality, I encourage you to create and upvote an item in uservoice:
https://onenote.uservoice.com/forums/245490-onenote-developer-apis