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
Access a different calendar than the main one #435
Comments
Rather than using a distinguished folder id, you need to pass the id of the calendar folder you wish to retrieve the events for. If you don't know that id, you can look it up using the Also, in the future, please complete the issue template in full and properly format your code using GFM. |
Dear James,
thank you so much to answer my questions. I really do appreciate it.
Unfortunately, I am a noob in php programming and my colleagues, who are more in expert doesn’t understand that neither.
What I have done is I used the
http://127.0.0.1/php-ews-master/examples/folder/find.php
which gives me a list and the IDs I guess.
Kalender AQMkADQ2ODRlMTA5LWY2MTgtNGI4Yi1iODVhLWM0NWE5YTcwYjQ1YgAuAAADOvkV5rJowESocALkkONERgEAaNTXLnnj7kyc+Fw5ZWxFkAAAAgENAAAA
Feiertage in Deutschland AAMkADQ2ODRlMTA5LWY2MTgtNGI4Yi1iODVhLWM0NWE5YTcwYjQ1YgAuAAAAAAA6+RXmsmjARKhwAuSQ40RGAQBo1NcueePuTJz4XDllbEWQAAAI/FJWAAA=
Geburtstage AAMkADQ2ODRlMTA5LWY2MTgtNGI4Yi1iODVhLWM0NWE5YTcwYjQ1YgAuAAAAAAA6+RXmsmjARKhwAuSQ40RGAQBo1NcueePuTJz4XDllbEWQAAAI/FJVAAA=
Event AQMkADQ2ODRlMTA5LWY2MTgtNGI4Yi1iODVhLWM0NWE5YTcwYjQ1YgAuAAADOvkV5rJowESocALkkONERgEAaNTXLnnj7kyc+Fw5ZWxFkAAAAg0kAAAA
But where do I have to hand over this IDs within the other script to make it access the other code:
http://127.0.0.1/php-ews-master/examples/event/find.php
This is a part of your code and it starts around line 35:
// Return all event properties. This is Line 37 in my script
$request->ItemShape = new ItemResponseShapeType();
$request->ItemShape->BaseShape = DefaultShapeNamesType::ALL_PROPERTIES;
$folder_id = new DistinguishedFolderIdType();
$folder_id->Id = DistinguishedFolderIdNameType::CALENDAR;
//$folder_id->Id = 'AQMkADQ2ODRlMTA5LWY2MTgtNGI4Yi1iODVhLWM0NWE5YTcwYjQ1YgAuAAADOvkV5rJowESocALkkONERgEAaNTXLnnj7kyc+Fw5ZWxFkAAAAg0kAAAA';
$request->ParentFolderIds->DistinguishedFolderId[] = $folder_id;
$request->CalendarView = new CalendarViewType();
$request->CalendarView->StartDate = $start_date->format('c');
$request->CalendarView->EndDate = $end_date->format('c');
$response = $client->FindItem($request);
When I uncomment the additional line with the ID, and restart it, I’ll got an error like this:
Fatal error: Uncaught SoapFault exception: [a:ErrorInvalidRequest] The request is invalid. in C:\xampp\htdocs\php-ews-master\src\Client.php:1631 Stack trace: #0 C:\xampp\htdocs\php-ews-master\src\Client.php(1631): SoapClient->__call('FindItem', Array) #1 C:\xampp\htdocs\php-ews-master\src\Client.php(1631): jamesiarmes\PhpNtlm\SoapClient->FindItem(Object(jamesiarmes\PhpEws\Request\FindItemType)) #2 C:\xampp\htdocs\php-ews-master\src\Client.php(670): jamesiarmes\PhpEws\Client->makeRequest('FindItem', Object(jamesiarmes\PhpEws\Request\FindItemType)) #3 C:\xampp\htdocs\php-ews-master\examples\event\find.php(52): jamesiarmes\PhpEws\Client->FindItem(Object(jamesiarmes\PhpEws\Request\FindItemType)) #4 {main} thrown in C:\xampp\htdocs\php-ews-master\src\Client.php on line 1631
Is this the wrong ID I got from the first script or is the handover of the ID wrong(what I assume).
It would be great if you could help me with that simple line.
Thanks again for your time.
Mathias
Von: James Armes [mailto:notifications@github.com]
Gesendet: Montag, 5. Juni 2017 15:20
An: jamesiarmes/php-ews
Cc: Mathias Blonski; Author
Betreff: Re: [jamesiarmes/php-ews] Access a different calendar than the main one (#435)
Rather than using a distinguished folder id, you need to pass the id of the calendar folder you wish to retrieve the events for. If you don't know that id, you can look it up using the FindFolder operation. It will be a sub-folder of the DistinguishedFolderIdNameType::CALENDAR folder.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#435 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ALuQPiSW9aHAre4kPvzSHrSC-M19SUtEks5sBACAgaJpZM4M8z3i>.
|
Dear James,
thank you so much to answer my questions. I really do appreciate it.
Unfortunately, I am a noob in php programming and my colleagues, who are more in expert doesn’t understand that neither.
What I have done is I used the
http://127.0.0.1/php-ews-master/examples/folder/find.php
which gives me a list and the IDs I guess.
Kalender AQMkADQ2ODRlMTA5LWY2MTgtNGI4Yi1iODVhLWM0NWE5YTcwYjQ1YgAuAAADOvkV5rJowESocALkkONERgEAaNTXLnnj7kyc+Fw5ZWxFkAAAAgENAAAA
Feiertage in Deutschland AAMkADQ2ODRlMTA5LWY2MTgtNGI4Yi1iODVhLWM0NWE5YTcwYjQ1YgAuAAAAAAA6+RXmsmjARKhwAuSQ40RGAQBo1NcueePuTJz4XDllbEWQAAAI/FJWAAA=
Geburtstage AAMkADQ2ODRlMTA5LWY2MTgtNGI4Yi1iODVhLWM0NWE5YTcwYjQ1YgAuAAAAAAA6+RXmsmjARKhwAuSQ40RGAQBo1NcueePuTJz4XDllbEWQAAAI/FJVAAA=
Event AQMkADQ2ODRlMTA5LWY2MTgtNGI4Yi1iODVhLWM0NWE5YTcwYjQ1YgAuAAADOvkV5rJowESocALkkONERgEAaNTXLnnj7kyc+Fw5ZWxFkAAAAg0kAAAA
But where do I have to hand over this IDs within the other script to make it access the other code:
http://127.0.0.1/php-ews-master/examples/event/find.php
This is a part of your code and it starts around line 35:
// Return all event properties. This is Line 37 in my script
$request->ItemShape = new ItemResponseShapeType();
$request->ItemShape->BaseShape = DefaultShapeNamesType::ALL_PROPERTIES;
$folder_id = new DistinguishedFolderIdType();
$folder_id->Id = DistinguishedFolderIdNameType::CALENDAR;
//$folder_id->Id = 'AQMkADQ2ODRlMTA5LWY2MTgtNGI4Yi1iODVhLWM0NWE5YTcwYjQ1YgAuAAADOvkV5rJowESocALkkONERgEAaNTXLnnj7kyc+Fw5ZWxFkAAAAg0kAAAA';
$request->ParentFolderIds->DistinguishedFolderId[] = $folder_id;
$request->CalendarView = new CalendarViewType();
$request->CalendarView->StartDate = $start_date->format('c');
$request->CalendarView->EndDate = $end_date->format('c');
$response = $client->FindItem($request);
When I uncomment the additional line with the ID, and restart it, I’ll got an error like this:
Fatal error: Uncaught SoapFault exception: [a:ErrorInvalidRequest] The request is invalid. in C:\xampp\htdocs\php-ews-master\src\Client.php:1631 Stack trace: #0 C:\xampp\htdocs\php-ews-master\src\Client.php(1631): SoapClient->__call('FindItem', Array) #1 C:\xampp\htdocs\php-ews-master\src\Client.php(1631): jamesiarmes\PhpNtlm\SoapClient->FindItem(Object(jamesiarmes\PhpEws\Request\FindItemType)) #2 C:\xampp\htdocs\php-ews-master\src\Client.php(670): jamesiarmes\PhpEws\Client->makeRequest('FindItem', Object(jamesiarmes\PhpEws\Request\FindItemType)) #3 C:\xampp\htdocs\php-ews-master\examples\event\find.php(52): jamesiarmes\PhpEws\Client->FindItem(Object(jamesiarmes\PhpEws\Request\FindItemType)) #4 {main} thrown in C:\xampp\htdocs\php-ews-master\src\Client.php on line 1631
Is this the wrong ID I got from the first script or is the handover of the ID wrong(what I assume).
It would be great if you could help me with that simple line.
Thanks again for your time.
Mathias
Von: James Armes [mailto:notifications@github.com]
Gesendet: Montag, 5. Juni 2017 15:20
An: jamesiarmes/php-ews
Cc: Mathias Blonski; Author
Betreff: Re: [jamesiarmes/php-ews] Access a different calendar than the main one (#435)
Rather than using a distinguished folder id, you need to pass the id of the calendar folder you wish to retrieve the events for. If you don't know that id, you can look it up using the FindFolder operation. It will be a sub-folder of the DistinguishedFolderIdNameType::CALENDAR folder.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#435 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ALuQPiSW9aHAre4kPvzSHrSC-M19SUtEks5sBACAgaJpZM4M8z3i>.
|
@mblonski2015 - Not sure if you found your answer. What you need is a user with privileges or impersonation rights to the "room" or mailbox you want to look at. Using the newest build, you could try the following: `<?php use \jamesiarmes\PhpEws\Client; use \jamesiarmes\PhpEws\ArrayType\NonEmptyArrayOfBaseFolderIdsType; use \jamesiarmes\PhpEws\Enumeration\DefaultShapeNamesType; use \jamesiarmes\PhpEws\Type\CalendarViewType; // Replace with the date range you want to search in. As is, this will find all // Set connection information. $client = new Client($host, $username, $password, $version); $request = new FindItemType(); $request->CalendarView = new CalendarViewType(); //if( $response_messages ){
} |
As I mentioned in my previous comment, please format all code using GFM. In your event find request, you need to replace the |
@jamesiarmes Thank you for the response, had to re-read what you wrote to see the difference between what you had said and I had written. That being said, when I tried using $request->ParentFolderIds->FolderId[] I do not get any event data back, while when I use $request->ParentFolderIds->DistinguishedFolderId[] I do get data back... |
Hey Bren, Hi James,
I am traveling right now, but I found some time to adjust it.
I am using this lines:
$folder_id->Id = 'AQMkAXXXXXXXXXXXXXXXXXX'; // Video
$request->ParentFolderIds->FolderId[] = $folder_id;
and it works for me perfectly.
thanks for your helping input.
Now I am getting a little greedy:
I don't get the text in "body", that means, what I wrote in the long text field in the calendar element, nor the user defined fields. I named them "Projektleiter" and " Personal",
but I always get:
Notice: Undefined property: jamesiarmes\PhpEws\Type\CalendarItemType::$Personal in C:\xampp\htdocs\php-ews-master\examples\event\find 2.php on line 82
Any tips on that issue as well?
Mathias
…________________________________
Von: Bren <notifications@github.com>
Gesendet: Mittwoch, 4. Oktober 2017 20:16:23
An: jamesiarmes/php-ews
Cc: Mathias Blonski; Mention
Betreff: Re: [jamesiarmes/php-ews] Access a different calendar than the main one (#435)
@jamesiarmes<https://github.com/jamesiarmes> Thank you for the response, had to re-read what you wrote to see the difference between what you had said and I had written. That being said, when I tried using $request->ParentFolderIds->FolderId[] I do not get any event data back, while when I use $request->ParentFolderIds->DistinguishedFolderId[] I do get data back...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#435 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ALuQPkwpvXIOpz6HK5NbUXsPmnbFq2OCks5so8t3gaJpZM4M8z3i>.
|
Hello,
I'd like to read all events from a exchange user's calendar. I can read the main one, but I don't know where I can submit the name of the other folder/calendar.
this is the part I am using:
$client = new Client($host, $username, $password, $version);
$client->setTimezone($timezone);
$request = new FindItemType();
$request->ParentFolderIds = new NonEmptyArrayOfBaseFolderIdsType();
// Return all event properties.
$request->ItemShape = new ItemResponseShapeType();
$request->ItemShape->BaseShape = DefaultShapeNamesType::ALL_PROPERTIES;
$folder_id = new DistinguishedFolderIdType();
$folder_id->Id = DistinguishedFolderIdNameType::CALENDAR;
$request->ParentFolderIds->DistinguishedFolderId[] = $folder_id;
$request->CalendarView = new CalendarViewType();
$request->CalendarView->StartDate = $start_date->format('c');
$request->CalendarView->EndDate = $end_date->format('c');
Can anybody give me a hint? The other calendars are called "birthday", "Event". Can I submit the real name or do I have to get an ID?
Thanks for your help.
Mathias
a beginner
The text was updated successfully, but these errors were encountered: