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

How to get medias appointment #253

Open
JGalbois opened this issue Sep 11, 2023 · 0 comments
Open

How to get medias appointment #253

JGalbois opened this issue Sep 11, 2023 · 0 comments

Comments

@JGalbois
Copy link

Hi

I am trying to retrieve the media attached to an appointment

	$calendar = $ews->ews->getCalendar();
	$oEventDetail = $calendar->getCalendarItem($ExchangeId, $ChangeKey);
	$attachments = $oEventDetail->getAttachments();

I see clearly 1 media

	tFileAttachment : Array
	(
		[0] => garethp\ews\API\Type\FileAttachmentType Object
			(
				[isContactPhoto] => 
				[content] => 
				[attachmentId] => garethp\ews\API\Type\AttachmentIdType Object
					(
						[rootItemId] => 
						[rootItemChangeKey] => 
						[id] => AAMkADZhNGEwMDM0LTUyYzQtNDY1Ni05YzhjLTk2NWY1NmY4OTA2MABGAAAAAADdQnAC3NjZSoBxMzH8bQlpBwAN5TKg81M8QL8H2m8inmvJAAAE8fPWAAAN5TKg81M8QL8H2m8inmvJAAB4IQvCAAABEgAQABIuYtzxgExAvD23NKSxL8s=
						[_] => 
						[_value] => 
						[_typeMap] => Array
							(
							)

					)

				[name] => titres.PNG
				[contentType] => image/png
				[contentId] => 
				[contentLocation] => 
				[size] => 1889
				[lastModifiedTime] => 2023-07-31T13:10:36
				[_typeMap] => Array
					(
						[lastModifiedTime] => dateTime
					)

				[isInline] => 
				[_] => 
				[_value] => 
			)

	)


I see the media key clearly
$tFileAttachment[0]->getAttachmentId();

Here is my trace

garethp\ews\API\Type\AttachmentIdType Object
	(
		[rootItemId] => 
		[rootItemChangeKey] => 
		[id] => AAMkADZhNGEwMDM0LTUyYzQtNDY1Ni05YzhjLTk2NWY1NmY4OTA2MABGAAAAAADdQnAC3NjZSoBxMzH8bQlpBwAN5TKg81M8QL8H2m8inmvJAAAE8fPWAAAN5TKg81M8QL8H2m8inmvJAAB4IQvCAAABEgAQABIuYtzxgExAvD23NKSxL8s=
		[_] => 
		[_value] => 
		[_typeMap] => Array
			(
			)

	)

But when I try to retrieve the content, I get an error

	$calendar->getAttachment($tFileAttachment[0]->getAttachmentId());
	>> Fatal error: Uncaught Error: Call to undefined method garethp\ews\CalendarAPI::getAttachment()

Do you have an idea how to do this?

Thank's

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