i had python script fetch schedule resource(room) company's office 365 calendar calling https://outlook.office365.com/api/v1.0/users/<roomname@companyname.com>/calendarview?startdatetime=2016-08-07 22:00:00&enddatetime=2016-08-08 22:00:00
this doesn't seem work anymore? far find out looks api has changed restricting permissions resource calendar. correct assumption or doing wrong?
is there way schedule resource?
i preferably want in python or c#
what's error message get? if getting error the access token acquired using authentication method weak allow access application
, need use certificate make request token instead of using client id , secret.
here code sample use certificate request token reference:
public static async task<string> gettokenbycert(string clientid, string tenant, string certthumbprint,string resource) { string authority = $"https://login.windows.net/{tenant}"; x509certificate2 cert = certhelper.findcert(certthumbprint); var certcred = new clientassertioncertificate(clientid, cert); var authcontext = new microsoft.identitymodel.clients.activedirectory.authenticationcontext(authority); authenticationresult result = null; try { result = await authcontext.acquiretokenasync(resource, certcred); } catch (exception ex) { } return result.accesstoken; }
more detail config/use certificate request token, please refer here.
Comments
Post a Comment