Sending a Message in Change On-line through REST from an Arduino MKR1000 That is half 2 of my MKR1000 article, on this earlier publish I checked out sending a Message through EWS utilizing Primary Authentication. On this Submit I will take a look at utilizing the brand new Outlook REST API which requires utilizing OAuth authentication to get an Entry Token.
The stipulations for this sketch are the identical as within the different publish with the addition of the ArduinoJson library https://github.com/bblanchon/ArduinoJson which is used to parse the Authentication Outcomes to extract the Entry Token. Additionally the SSL certificates for the login.home windows.web and outlook.workplace365.com should be uploaded to the gadgets utilizing the wifi101 Firmware updater.
To make use of Token Authentication you want to register an Software in Azure https://msdn.microsoft.com/en-us/workplace/workplace365/howto/add-common-consent-manually with the Mail.Ship permission. The applying must be a Native Shopper app that use the Out of Band Callback urn:ietf:wg:oauth:2.0:oob. It is advisable to authorize it in you tenant (eg construct a small app that may do this which can immediate for authorization). One that’s finished you then must set that ClientId variable within the sketch
String ClientId = “8fe353d6-efa0-4b0f-aafb-ab7cf3a9b307”;
I’ve put a replica of this Sketch up https://github.com/gscales/Arduino-MRK1000/blob/grasp/REST-Workplace365SendSample.ino the code seems like