3

I'm trying to create a subscription to MS Graph for MS Teams chats. I've been reading through this documentation: https://learn.microsoft.com/en-us/graph/teams-changenotifications-teammembership

The sample POST message looks like this:

POST https://graph.microsoft.com/v1.0/subscriptions
Content-Type: application/json

{
  "changeType": "created,deleted,updated",
  "notificationUrl": "https://webhook.azurewebsites.net/api/resourceNotifications",
  "resource": "/teams/{team-id}/members",
  "includeResourceData": true,
  "encryptionCertificate": "{base64encodedCertificate}",
  "encryptionCertificateId": "{customId}",
  "expirationDateTime": "2019-09-19T11:00:00.0000000Z",
  "clientState": "{secretClientState}"
}

It's not clear to me how I would create the encryption certificate or the certificateId values

I'm currently googling / poking around in the MS graph docs but if someone could just point me to the right article, I'd appreciate it.

dot
  • 14,928
  • 41
  • 110
  • 218

1 Answers1

2

You need to create a certificate on Azure, and store it in a Vault. Then when you will create the Subscription you will use:

  • encryptionCertificate property ( certificate that you created )
  • encryptionCertificateId property ( your own identifier )

Follow these instructions on the GraphAPI doc -> Develop\Use the API\Change notifications -> Notifications with resource data Managing encryption keys that you need for Notifications

I recommend you to go thru this doc, which is more complete that the example you got. And don't forget to validate de endpoint! describe in this doc too. Setup a subscription with resource data

The formal description of these two fields: Subscription Properties

I hope it helps :)