Welcome! Log In Create A New Profile

Advanced

WD25 - Microsoft 365 Calendar

WD25 - Microsoft 365 Calendar
October 08, 2020 05:39AM
Hi All

Has anyone managed to read MS 365 calendars? If so - how?

Cheers
André
pao
Re: WD25 - Microsoft 365 Calendar
October 12, 2020 09:55AM
Yes,
Using the MS GRAPH API [docs.microsoft.com]

Sample code to list the events:
//
PROCEDURE LIST_EVENTS_MSFT(p_access_token,p_user_id,p_calend)


res_var is Variant
res_var1 is Variant



HTTPTimeOut(600000)
HTTP.IgnoreError = httpIgnoreInvalidCertificate+httpIgnoreInvalidCertificateName+httpIgnoreExpiredCertificate+httpIgnoreRedirectToHTTP+httpIgnoreRedirectToHTTPS

cMyRequest is httpRequest
cMyRequest..URL = "[graph.microsoft.com];
cMyRequest..Header["Authorization"]="Bearer "+p_access_token
cMyRequest..IgnoreError = httpIgnoreInvalidCertificate+httpIgnoreInvalidCertificateName+httpIgnoreExpiredCertificate+httpIgnoreRedirectToHTTP+httpIgnoreRedirectToHTTPS
cMyRequest..Method=httpGet
cMyResponse is httpResponse = HTTPSend(cMyRequest)
IF ErrorOccurred THEN
Error("Error ",ErrorInfo(errFullDetails))
END

WHEN EXCEPTION IN
res_var=JSONToVariant(cMyResponse..Content)
DO
Info("Error in JSON ",cMyResponse..Content)
RETURN
END


IF res_var.error..Exist THEN
Info("error in result ",cMyResponse..Content)
RETURN
END

FOR i=1 _TO_ res_var.value..Occurrence
res_var1=res_var.value
MOSTRA_RESULTADO=VariantToJSON(res_var1,psdFormatting)
MyWindow..Plane=3
WHILE MyWindow..Plane<>2
Multitask(-1)
CONTINUE
END

END

Regards

Paulo Oliveira
Re: WD25 - Microsoft 365 Calendar
November 02, 2020 09:20AM
Hi Paulo

Thanks a ton for that. Will give it a bash.

Cheers
André
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: