dvelopp
dvelopp

Reputation: 4295

Hot to enable Cloud Elements Microsoft Graph Calendar webhooks for all calendars?

By default, when I integrate my Microsoft account with cloud elements:

https://developers.cloud-elements.com/docs/elements/microsoftgraph/

I only get notifications for my default calendar. But, in fact, I have like 5+ calendars. I want to get notifications about changes in all of them.

For now, I can only think of making a new end-point that accepts calendar ID and then I invoke this endpoint with the result of invocation:

GET /calendars

But, this looks like a hack. Is there a better solution to listen to all the calendars that I have using Cloud Elements?

Upvotes: 1

Views: 74

Answers (2)

Jamie T
Jamie T

Reputation: 33

In the Cloud Elements UI, if you select the instance and click the api docs you will see four sections "information", "setup", "resources", and "models". Select resources and you will see one that has POST /webhooks This is the call the Cloud Elements sends on webhook provision. If you want to change the body of the webhook go to the PreRequest Hook where you will see javascript that is creating a post body that will be sent to Microsoft.

By default the body you see in the javascript looks like:

var body={
  "changeType": "created,updated,deleted",
  "notificationUrl": "{webhookCallbackUrl}",
  "resource": "/me/events",
  "expirationDateTime": newDate
}

If you want to change what resources you get notification for you can do so in this body and using the documentation that was provided in the previous answer

Upvotes: 1

Keen Jin
Keen Jin

Reputation: 1138

According to your description, I assume you want to get the notifications for your calendar when the calendar changed.

We can use the subscription endpoint to get the notifications. For more detail about this endpoint, we can refer to this document

Upvotes: 1

Related Questions