2

I'm developing a service to synchronize Dolibarr calendar with Outlook calendar.

I'm first trying to create an event in the Outlook mailbox. I have looked on different forums and tried many different things, but I still have this issue:

Code: ResourceNotFound

Message: Resource could not be discovered.

I have created an API on Microsoft Azure with the following API authorizations:

enter image description here

Step 1: Authentication & authorization

I'm asking the user authorization to create an event in the calendar:

https://login.microsoftonline.com/########/oauth2/V2.0/authorize?
client_id=2c4*******
&scope=openid+offline_access+User.Read+Calendars.Read+Calendars.ReadWrite
&response_type=code

Step 2: Get access token

Then I get a code to request the access-token:

https://login.microsoftonline.com/########/oauth2/V2.0/token

with the following data (json):

"grant_type" => "authorization_code",
"code" => "{previous_code}",
"client_id" => "2c4*******",
"client_secret" => "p0i********"

I finally get the token and seem to be well authenticated.

Step 3: POST an event

https://graph.microsoft.com/v1.0/me/events

with the following headers:

'Content-Type: application.json'
'Authorization: Bearer {token}'

and the following data (json):

"subject": "....",
"body": {
  "contentType": "HTML",
  "content": "..."
},
"start": {
  "dateTime": "2020-09-16 10:00:00",
  "timeZone": "Pacific Standard Time"
},
"end": {
  "dateTime": "2020-09-16 13:00:00",
  "timeZone": "Pacific Standard Time"
}

And I have this error

enter image description here

Do you have any idea why I have this issue?

(I precise I'm using my student account)

YaatSuka
  • 47
  • 6

0 Answers0