Share via


Événements Microsoft Outlook

Cet article fournit les propriétés et le schéma des événements Microsoft Outlook, publiés par l’API Microsoft Graph. Pour une introduction aux schémas d’événements, consultez le schéma CloudEvents.

Types d’événement disponibles

Ces événements sont déclenchés lorsqu’un événement Outlook ou un contact Outlook est créé, mis à jour ou supprimé ou en utilisant ces ressources à l’aide de l’API Microsoft Graph.

Nom d'événement Description
Microsoft.Graph.EventCreated Déclenché lorsqu’un événement dans Outlook est créé.
Microsoft.Graph.EventUpdated Déclenché lorsqu’un événement dans Outlook est mis à jour.
Microsoft.Graph.EventDeleted Déclenché lorsqu’un événement dans Outlook est supprimé.
Microsoft.Graph.ContactCreated Déclenché lorsqu’un contact dans Outlook est créé.
Microsoft.Graph.ContactUpdated Déclenché lorsqu’un contact dans Outlook est mis à jour.
Microsoft.Graph.ContactDeleted Déclenché lorsqu’un contact dans Outlook est supprimé.

Exemple d’événement

Lorsqu’un événement est déclenché, le service Event Grid envoie les données relatives à cet événement aux destinations d’abonnement. Cette section contient un exemple de ce à quoi ces données ressembleraient pour chaque événement Outlook.

Événement Microsoft.Graph.EventCreated

{
	"id": "00d8a100-2e92-4bfa-86e1-0056dacd0fce",
	"type": "Microsoft.Graph.EventCreated",
	"source": "/tenants/<tenant-id>/applications/<application-id>",
	"subject": "Events/<event-id>",
	"time": "2022-05-24T22:24:31.3062901Z",
	"datacontenttype": "application/json",
	"specversion": "1.0",
	"data": {
		"@odata.type": "#Microsoft.OutlookServices.Notification",
		"Id": null,
		"SubscriptionExpirationDateTime": "2019-02-14T23:56:30.1307708Z",
		"ChangeType": "created",
		"subscriptionId": "MTE1MTVlYTktMjVkZS00MjY3LWI1YzYtMjg0NzliZmRhYWQ2",
		"resource": "https://outlook.office365.com/api/beta/Users('userId@tenantId')/Events('<event id>')",
		"clientState": "<client state>",
		"resourceData": {
			"Id": "<event id>",
			"@odata.etag": "<tag id>",
			"@odata.id": "https://outlook.office365.com/api/beta/Users('userId@tenantId')/Events('<event id>')",
			"@odata.type": "#Microsoft.OutlookServices.Event",
			"OtherResourceData": "<some other resource data>"
		}
	}
}

Événement Microsoft.Graph.EventUpdated

{
	"id": "00d8a100-2e92-4bfa-86e1-0056dacd0fce",
	"type": "Microsoft.Graph.EventUpdated",
	"source": "/tenants/<tenant-id>/applications/<application-id>",
	"subject": "Events/<event-id>",
	"time": "2022-05-24T22:24:31.3062901Z",
	"datacontenttype": "application/json",
	"specversion": "1.0",
	"data": {
		"@odata.type": "#Microsoft.OutlookServices.Notification",
		"Id": null,
		"SubscriptionExpirationDateTime": "2019-02-14T23:56:30.1307708Z",
		"ChangeType": "updated",
		"subscriptionId": "MTE1MTVlYTktMjVkZS00MjY3LWI1YzYtMjg0NzliZmRhYWQ2",
		"resource": "https://outlook.office365.com/api/beta/Users('userId@tenantId')/Events('<event id>')",
		"clientState": "<client state>",
		"resourceData": {
			"Id": "<event id>",
			"@odata.etag": "<tag id>",
			"@odata.id": "https://outlook.office365.com/api/beta/Users('userId@tenantId')/Events('<event id>')",
			"@odata.type": "#Microsoft.OutlookServices.Event",
			"OtherResourceData": "<some other resource data>"
		}
	}
}

Événement Microsoft.Graph.EventDeleted

{
	"id": "00d8a100-2e92-4bfa-86e1-0056dacd0fce",
	"type": "Microsoft.Graph.EventDeleted",
	"source": "/tenants/<tenant-id>/applications/<application-id>",
	"subject": "Events/<event-id>",
	"time": "2022-05-24T22:24:31.3062901Z",
	"datacontenttype": "application/json",
	"specversion": "1.0",
	"data": {
		"@odata.type": "#Microsoft.OutlookServices.Notification",
		"Id": null,
		"SubscriptionExpirationDateTime": "2019-02-14T23:56:30.1307708Z",
		"ChangeType": "deleted",
		"subscriptionId": "MTE1MTVlYTktMjVkZS00MjY3LWI1YzYtMjg0NzliZmRhYWQ2",
		"resource": "https://outlook.office365.com/api/beta/Users('userId@tenantId')/Events('<event id>')",
		"clientState": "<client state>",
		"resourceData": {
			"Id": "<event id>",
			"@odata.etag": "<tag id>",
			"@odata.id": "https://outlook.office365.com/api/beta/Users('userId@tenantId')/Events('<event id>')",
			"@odata.type": "#Microsoft.OutlookServices.Event",
			"OtherResourceData": "<some other resource data>"
		}
	}
}

Événement Microsoft.Graph.ContactCreated

{
	"id": "00d8a100-2e92-4bfa-86e1-0056dacd0fce",
	"type": "Microsoft.Graph.ContactCreated",
	"source": "/tenants/<tenant-id>/applications/<application-id>",
	"subject": "Contacts/<contact-id>",
	"time": "2022-05-24T22:24:31.3062901Z",
	"datacontenttype": "application/json",
	"specversion": "1.0",
	"data": {
		"@odata.type": "#Microsoft.OutlookServices.Notification",
		"Id": null,
		"SubscriptionExpirationDateTime": "2019-02-14T23:56:30.1307708Z",
		"ChangeType": "created",
		"subscriptionId": "MTE1MTVlYTktMjVkZS00MjY3LWI1YzYtMjg0NzliZmRhYWQ2",
		"resource": "https://outlook.office365.com/api/beta/Users('userId@tenantId')/Contacts('<contact id>')",
		"clientState": "<client state>",
		"resourceData": {
			"Id": "<contact id>",
			"@odata.etag": "<tag id>",
			"@odata.id": "https://outlook.office365.com/api/beta/Users('userId@tenantId')/Contacts('<contact id>')",
			"@odata.type": "#Microsoft.OutlookServices.Contact",
			"OtherResourceData": "<some other resource data>"
		}
	}
}

Événement Microsoft.Graph.ContactUpdated

{
	"id": "00d8a100-2e92-4bfa-86e1-0056dacd0fce",
	"type": "Microsoft.Graph.ContactUpdated",
	"source": "/tenants/<tenant-id>/applications/<application-id>",
	"subject": "Contacts/<contact-id>",
	"time": "2022-05-24T22:24:31.3062901Z",
	"datacontenttype": "application/json",
	"specversion": "1.0",
	"data": {
		"@odata.type": "#Microsoft.OutlookServices.Notification",
		"Id": null,
		"SubscriptionExpirationDateTime": "2019-02-14T23:56:30.1307708Z",
		"ChangeType": "updated",
		"subscriptionId": "MTE1MTVlYTktMjVkZS00MjY3LWI1YzYtMjg0NzliZmRhYWQ2",
		"resource": "https://outlook.office365.com/api/beta/Users('userId@tenantId')/Contacts('<contact id>')",
		"clientState": "<client state>",
		"resourceData": {
			"Id": "<contact id>",
			"@odata.etag": "<tag id>",
			"@odata.id": "https://outlook.office365.com/api/beta/Users('userId@tenantId')/Contacts('<contact id>')",
			"@odata.type": "#Microsoft.OutlookServices.Contact",
			"OtherResourceData": "<some other resource data>"
		}
	}
}

Événement Microsoft.Graph.ContactDeleted

{
	"id": "00d8a100-2e92-4bfa-86e1-0056dacd0fce",
	"type": "Microsoft.Graph.ContactDeleted",
	"source": "/tenants/<tenant-id>/applications/<application-id>",
	"subject": "Contacts/<contact-id>",
	"time": "2022-05-24T22:24:31.3062901Z",
	"datacontenttype": "application/json",
	"specversion": "1.0",
	"data": {
		"@odata.type": "#Microsoft.OutlookServices.Notification",
		"Id": null,
		"SubscriptionExpirationDateTime": "2019-02-14T23:56:30.1307708Z",
		"ChangeType": "deleted",
		"subscriptionId": "MTE1MTVlYTktMjVkZS00MjY3LWI1YzYtMjg0NzliZmRhYWQ2",
		"resource": "https://outlook.office365.com/api/beta/Users('userId@tenantId')/Contacts('<contact id>')",
		"clientState": "<client state>",
		"resourceData": {
			"Id": "<contact id>",
			"@odata.etag": "<tag id>",
			"@odata.id": "https://outlook.office365.com/api/beta/Users('userId@tenantId')/Contacts('<contact id>')",
			"@odata.type": "#Microsoft.OutlookServices.Contact",
			"OtherResourceData": "<some other resource data>"
		}
	}
}

Propriétés d’événement

Un événement contient les données générales suivantes :

Propriété Type Description
source string Source d’événement du locataire. Ce champ n’est pas modifiable. L’API Microsoft Graph fournit cette valeur.
subject string Chemin de l’objet de l’événement, défini par le serveur de publication.
type string Un des types d’événements pour cette source d’événement.
time string Heure à laquelle l’événement est généré selon l’heure UTC du fournisseur
id string Identificateur unique de l’événement.
data object Charge utile d’événement qui fournit les données relatives au changement d’état de la ressource.
specversion string Version de la spécification de schéma CloudEvents.

L’objet de données comporte les propriétés suivantes :

Propriété Type Description
changeType string Type de modification de l’état de la ressource.
resource string Identificateur de ressource pour lequel l’événement a été déclenché.
tenantId string ID d’organisation où l’utilisateur ou le contact est conservé.
clientState string Secret fourni par l’utilisateur au moment de la création de l’abonnement à l’API Graph.
@odata.type string Type de modification de l’API Graph.
@odata.id string Identificateur de ressource de l’API Graph pour lequel l’événement a été déclenché.
id string Identificateur de ressource pour lequel l’événement a été déclenché.
organizationId string Identificateur du locataire Outlook.
eventTime string Heure à laquelle l’état de la ressource a eu lieu.
sequenceNumber string Numéro séquentiel.
subscriptionExpirationDateTime string Heure au format RFC 3339 à laquelle l’abonnement à l’API Graph expire.
subscriptionId string Identificateur d’abonnement à l’API Graph.
tenantId string Identificateur du locataire Outlook.
otherResourceData string Espace réservé qui représente une ou plusieurs propriétés dynamiques qui peuvent être incluses dans l’événement.

Étapes suivantes