php-ews icon indicating copy to clipboard operation
php-ews copied to clipboard

Get multiple users delegated calendars

Open hd74 opened this issue 9 years ago • 0 comments

Hi! I was wondering if someone knew how to return the calendar from multiple users? The code below works if I have an array with only one optional user calendar, but I can't figure out how to get two or more users delegated calendars. Any ideas?

$api = API::withUsernameAndPassword($ews_server, $ews_username, $password);
$calendar = $api->getCalendar();
$items = $calendar->getCalendarItems(new DateTime('1:00 AM'), new DateTime('11:59 PM'), array (
	'ParentFolderIds' => array (
		'DistinguishedFolderId' => array (
			'Id' => 'calendar',
			'Mailbox' => array (
				'EmailAddress' => '[email protected]'
			)
		)
	)
));

I though maybe this would work, but it doesn't:

$api = API::withUsernameAndPassword($ews_server, $ews_username, $password);
$calendar = $api->getCalendar();
$items = $calendar->getCalendarItems(new DateTime('1:00 AM'), new DateTime('11:59 PM'), array (
	'ParentFolderIds' => array (
		'DistinguishedFolderId' => array (
			'Id' => 'calendar',
			'Mailbox' => array (
				'EmailAddress' => '[email protected]',
				'EmailAddress' => '[email protected]'
			)
		)
	)
));

hd74 avatar Dec 09 '16 22:12 hd74