Compartir a través de


Eventos de Microsoft Outlook

En este artículo se proporcionan las propiedades y el esquema de los eventos de Microsoft Outlook que publica la API de Microsoft Graph. Para obtener una introducción a los esquemas de eventos, consulte Esquema de CloudEvents.

Tipos de eventos disponibles

Nombre del evento Descripción
Microsoft.Graph.EventCreated Se desencadena cuando se crea un evento en Outlook.
Microsoft.Graph.EventUpdated Se desencadena cuando se actualiza un evento en Outlook.
Microsoft.Graph.EventDeleted Se desencadena cuando se elimina un evento en Outlook.
Microsoft.Graph.ContactCreated Se desencadena cuando se crea un contacto en Outlook.
Microsoft.Graph.ContactUpdated Se desencadena cuando se actualiza un contacto en Outlook.
Microsoft.Graph.ContactDeleted Se desencadena cuando se elimina un contacto en Outlook.
Microsoft.Graph.MessageCreated Se desencadena cuando se crea un contacto en Outlook.
Microsoft.Graph.MessageUpdated Se desencadena cuando se actualiza un mensaje en Outlook.
Microsoft.Graph.MessageDeleted Se desencadena cuando se elimina un mensaje en Outlook.

Evento de ejemplo

Cuando se desencadena un evento, el servicio Event Grid envía datos sobre ese evento a los destinos de suscripción. Esta sección contiene un ejemplo del aspecto que deben tener los datos para cada evento de Outlook.

Evento 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": "2024-05-22T22:24:31.3062901Z",
	"datacontenttype": "application/json",
	"specversion": "1.0",
	"data": {
		"@odata.type": "#Microsoft.OutlookServices.Notification",
		"Id": null,
		"SubscriptionExpirationDateTime": "2024-06-22T23: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>"
		}
	}
}

Evento 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": "2024-05-22T22:24:31.3062901Z",
	"datacontenttype": "application/json",
	"specversion": "1.0",
	"data": {
		"@odata.type": "#Microsoft.OutlookServices.Notification",
		"Id": null,
		"SubscriptionExpirationDateTime": "2024-06-22T23: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>"
		}
	}
}

Evento 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": "2024-05-22T22:24:31.3062901Z",
	"datacontenttype": "application/json",
	"specversion": "1.0",
	"data": {
		"@odata.type": "#Microsoft.OutlookServices.Notification",
		"Id": null,
		"SubscriptionExpirationDateTime": "2024-06-22T23: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>"
		}
	}
}

Evento 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": "2024-05-22T22:24:31.3062901Z",
	"datacontenttype": "application/json",
	"specversion": "1.0",
	"data": {
		"@odata.type": "#Microsoft.OutlookServices.Notification",
		"Id": null,
		"SubscriptionExpirationDateTime": "2024-06-22T23: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>"
		}
	}
}

Evento 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": "2024-05-22T22:24:31.3062901Z",
	"datacontenttype": "application/json",
	"specversion": "1.0",
	"data": {
		"@odata.type": "#Microsoft.OutlookServices.Notification",
		"Id": null,
		"SubscriptionExpirationDateTime": "2024-06-22T23: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>"
		}
	}
}

Evento 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": "2024-05-22T22:24:31.3062901Z",
	"datacontenttype": "application/json",
	"specversion": "1.0",
	"data": {
		"@odata.type": "#Microsoft.OutlookServices.Notification",
		"Id": null,
		"SubscriptionExpirationDateTime": "2024-06-22T23: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>"
		}
	}
}

Evento Microsoft.Graph.MessageCreated

{
	"id": "00d8a100-2e92-4bfa-86e1-0056dacd0fce",
	"type": "Microsoft.Graph.MessageCreated",
	"source": "/tenants/<tenant-id>/applications/<application-id>",
	"subject": "Users/<user-id>/Messages/<messaeg-id>",
	"time": "2024-05-22T22:24:31.3062901Z",
	"datacontenttype": "application/json",
	"specversion": "1.0",
	"data": {
		"@odata.type": "#Microsoft.OutlookServices.Notification",
		"Id": null,
		"SubscriptionExpirationDateTime": "2024-06-22T23:56:30.1307708Z",
		"ChangeType": "created",
		"subscriptionId": "MTE1MTVlYTktMjVkZS00MjY3LWI1YzYtMjg0NzliZmRhYWQ2",
		"resource": "Users/<user-id>/Messages/<message-id>",
		"clientState": "<client state>",
		"tenantId":"<tenant-id>",
		"resourceData": {
			"Id": "<message id>",
			"@odata.etag": "<tag id>",
			"@odata.id": "Users/<user-id>/Messages/<message-id>",
			"@odata.type": "#Microsoft.OutlookServices.Message",
			"OtherResourceData": "<some other resource data>"
		}
	}
}

Evento Microsoft.Graph.MessageUpdated

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

Evento Microsoft.Graph.MessageDeleted

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

Propiedades de evento

Un evento tiene los siguientes datos de nivel superior:

Propiedad Tipo Description
source string El origen de eventos del inquilino. En este campo no se puede escribir. Microsoft Graph API proporciona este valor.
subject string Ruta al asunto del evento definida por el anunciante.
type string Uno de los tipos de evento registrados para este origen de eventos.
time string La hora de generación del evento en función de la hora UTC del proveedor
id string Identificador único para el evento
data object Carga de eventos que proporciona los datos sobre el cambio de estado del recurso.
specversion string Versión de especificación del esquema CloudEvents.

El objeto data tiene las siguientes propiedades:

Propiedad Tipo Description
changeType string El tipo de cambio de estado del recurso.
resource string El identificador de recurso para el que se ha generado el evento.
tenantId string El Id. de la organización donde se mantiene el usuario o el contacto.
clientState string Un secreto proporcionado por el usuario en el momento de la creación de la suscripción de Graph API.
@odata.type string El tipo de cambio de Graph API.
@odata.id string El identificador de recursos de Graph API para el que se ha generado el evento.
id string El identificador de recurso para el que se ha generado el evento.
organizationId string El identificador de inquilino de Outlook.
eventTime string Hora a la que se produjo el estado del recurso.
sequenceNumber string Número de secuencia.
subscriptionExpirationDateTime string La hora en formato de Solicitud de cambio (RFC) 3339 en la que expira la suscripción de Graph API.
subscriptionId string El identificador de la suscripción de Graph API.
tenantId string El identificador de inquilino de Outlook.
otherResourceData string Marcador de posición que representa una o varias propiedades dinámicas que se pueden incluir en el evento.

Pasos siguientes