Comments (10)
Thanks for contacting me. As it stands I don't have the ability to test out Office 365 myself, I don't have any accounts with which to develop, hence only being able to get as far as working with the Auth Token. Are there different permissions you can give the application itself? Note that this library is for EWS, the SOAP API, not the new REST API. I know that Office 365 supports EWS, but I'm not sure what permissions you need to grant the app when you register the application.
As for your other question, if you want to see the requests going in and out, try breakpoints in NTMLSoapClient::__doRequest()
. It's done using Guzzle, so you should be able to see the requests in PSR7
from php-ews.
Thanks for your reply. I will look further into this tomorrow.
Must admit that my mind is pretty clouded by Microsoft's various API's, versions, products, etc. Their documentation truly is a maze (and stuffed with 404's while on it).
I've been following this step-by-step guide to see in what direction it goes, and this seems to be working:
https://dev.outlook.com/RestGettingStarted/Tutorial/php
I will follow up.
from php-ews.
That would be their REST API. It's pretty new, and nice, but not what this library is supporting. This library is built for their Exchange Web Services, which is a SOAP API. It wraps around a WSDL file and communicates with Exchange through XML calls. The reason I built this is because my work needed to communicate with a local Exchange 2007/2010 server, and they don't support REST. The starting point for that seems to be here, but that uses their Managed API as reference, which is a library they built for C#. If you google "EWS" and your use case, you'll find articles from Microsoft that explain things in C# and in XML, such as this. There is zero support for PHP, and no examples for it, hence this library.
If you only need to work with Office 365, I'd suggest not using this library and using REST from the start. REST is a nice standard to work with, and as you can see there's PHP examples for it
from php-ews.
Thanks for your help and input so far. Our case was exactly the same: communicating with a local Exchange 2010 server. However, we recently migrated to Office365, and I was hoping to simply switch from API::withUsernameAndPassword
to API::withCallbackToken
and be done with it.
But apparently, that won't work.
I'll dive into using the REST API, and take it from there.
from php-ews.
Sorry about that. Once I'm able to get started with Office365 at some point myself, I'll investigate the how and why it doesn't work
from php-ews.
So I've finally been able to sign up for a dev account (I wasn't able to before), and I'll be testing this now and writing up some docs. In the mean time, I used the old way of doing it and it worked without a hitch, no OAuth2 involved. Here's what I used that worked
use jamesiarmes\PEWS\Mail\MailAPI as API;
$api = API::withUsernameAndPassword('https://outlook.office365.com', '[email protected]', 'myPasssword');
$items = $api->getMailItems();
What do you get when you try to use UsernameAndPassword for office365.com?
from php-ews.
Oh wow. I can't believe I did not even try that in the first place. It works!
Having seen the workingWithOffice365.php example, I jumped straight into the token-business.
Is there any reason to assume Microsoft will stop supporting the SOAP API for Office365 in the future?
from php-ews.
Probably not, no. They're very big on backwards compatibility and seem to still be supporting it and releasing new features for it. I'm still working on getting OAuth with EWS going.
from php-ews.
Awesome. Let's hope this thread will help at least a few other lost souls in the future :)
from php-ews.
I've also improved the documentation for EWS over OAuth, if that's the street you want to go down. Turns out you can't have granular permissions for it, so in your Azure AD app configuration, you need to get it the "Access mailboxes as the signed-in user via Exchange Web Services" permission for "Office 365 Exchange Online"
from php-ews.
Related Issues (20)
- Create a contact
- internetMessageHeaders HOT 1
- BUG FreeBusyResponse array HOT 1
- toRecipients getting null values for inplace archive mails
- Update Mail Item -> Categorize Email HOT 1
- PHP 8.2 - Deprecated dynamic properties HOT 5
- Oauth is not working with Exchange 2013
- Issue with using toRecipients property in EWS restriction HOT 2
- Daylight Savings
- How to get medias appointment
- Update contact with ExtendedProperty
- Exceptions
- Set a calendar event with custom identifier, so that I can (later on) GET an event by the same identifier HOT 3
- Change "busy" status for event. HOT 2
- Checking if an item exists (by $itemId and $changeKey) results in FATAL ERROR if the object is not found - How to handle this? HOT 1
- Also delete recurring events when master event is deleted? HOT 1
- getLegacyFreeBusyStatus() does not return WorkingElsewhere HOT 1
- Authentication error after Exchange Extended Protection was enabled HOT 2
- Add Kerberos support
- How to forward an Email
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-ews.