Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set a calendar event with custom identifier, so that I can (later on) GET an event by the same identifier #256

Open
Lxxrxns opened this issue Dec 20, 2023 · 3 comments

Comments

@Lxxrxns
Copy link

Lxxrxns commented Dec 20, 2023

Hey there!

Thank you for this excellent PHP library!

I am trying to make a script that synchronizes a schedule I have in my MySQL database to an EWS.
To do this, I was hoping to set a unique field in the EWS event data that I can later select, i.e. a unique number that I can search for to then get the $itemId to update or delete the event later if necessary.

In the examples, I was only able to find code that selects the FIRST event ( $item = $calendar->getCalendarItems()[0] ) (or any other event if the position in the array is known), but my question is:

Is it possible to do something like:

$calendar->createCalendarItems(array(
    'uniqueIdentifier' => 'abc123',
    'Subject' => 'Test',
    'Start' => $start->format('c'),
    'End' => $end->format('c')
));

And then later on do something like:

getCalendarItems( WHERE uniqueIdentifier = "abc123" )

I could then get the $itemId (the EWS id of the event) and perform other actions such as updateCalendarItem() on that $itemId.

Ideally, the uniqueIdentifier is not visible (or at least not easily EDITABLE) in Outlook for the end user, because that would break the link between my database and the EWS. For example, using a unique code in the event subject is not an option, because this will (a) be very ugly in the user's Outlook and (b) be editable, which would make the EWS event unfindable later on.

Any help would be greatly appreciated.

Laurens

@Lxxrxns
Copy link
Author

Lxxrxns commented Dec 20, 2023

Update: so I read on StackOverflow that every event in EWS also has a "icalUId" (in the Graph API version), and I'm thinking the "old" EWS also has something similar called "uID".

Is there a way get the $itemId from an event by searching for its uID?

I found this: jamesiarmes#508
but that is for jamesiarmes' version... Would that also work here?

@Lxxrxns
Copy link
Author

Lxxrxns commented Dec 21, 2023

Basically, what I'm trying to do is this:

https://social.msdn.microsoft.com/Forums/exchange/en-US/1f623537-03ce-486e-8e33-4df38b513017/find-an-event-with-a-specific-uid-using-exchange-web-services-2010

Is there a class in php-ews that would work like this? Or is it possible to add one?

@Lxxrxns
Copy link
Author

Lxxrxns commented Dec 21, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant