tipo de recurso de assinaturasubscription resource type
Uma assinatura permite que um aplicativo cliente receba notificações sobre dados no Microsoft Graph.A subscription allows a client app to receive notifications about changes to data in Microsoft Graph. Atualmente, as assinaturas estão habilitadas para as seguintes coleções de recursos:Currently, subscriptions are enabled for the following resources:
- Um [mensagem][], [evento][], ou contato no OutlookA message, event, or contact in Outlook
- Um conversa de um grupo do Office 365A conversation of an Office 365 group
- Conteúdo da hierarquia de uma pasta raiz driveItem no OneDrive for Business ou de uma pasta raiz ou uma subpasta driveItem no OneDrive pessoal do usuárioContent in the hierarchy of a root folder driveItem in OneDrive for Business, or of a root folder or subfolder driveItem in a user's personal OneDrive
- Um [usuário][] ou [grupo][] no Azure Active DirectoryA user or group in Azure Active Directory
- Um [alerta][] da API de Segurança do Microsoft GraphAn alert from the Microsoft Graph Security API
Representação JSONJSON representation
Veja a seguir uma representação JSON do recurso.Here is a JSON representation of the resource.
{
"changeType": "string",
"notificationUrl": "string",
"resource": "string",
"applicationId" : "string",
"expirationDateTime": "String (timestamp)",
"id": "string (identifier)",
"clientState": "string",
"creatorId": "string"
}
PropriedadesProperties
PropriedadeProperty | TipoType | DescriçãoDescription |
---|---|---|
changeTypechangeType | cadeia de caracteresstring | Obrigatório.Required. Indica o tipo de alteração no recurso inscrito que gerará uma notificação.Indicates the type of change in the subscribed resource that will raise a notification. Os valores com suporte são: created , updated , deleted .The supported values are: created , updated , deleted . Vários valores podem ser combinados usando uma lista separada por vírgula.Multiple values can be combined using a comma-separated list.Observação: As notificações do item na raiz da unidade suportam somente updated changeType.Note: Drive root item notifications support only the updated changeType. Notificações de grupos e usuário suportam updated e deleted changeType.User and group notifications support updated and deleted changeType. |
notificationUrlnotificationUrl | cadeia de caracteresstring | Obrigatório.Required. A URL do ponto de extremidade que receberá as notificações.The URL of the endpoint that will receive the notifications. Esta URL deve usar o protocolo HTTPS.This URL must make use of the HTTPS protocol. |
recursoresource | cadeia de caracteresstring | Obrigatório.Required. Especifica o recurso que será monitorado para detectar alterações.Specifies the resource that will be monitored for changes. Não incluir a URL base (https://graph.microsoft.com/v1.0/ ).Do not include the base URL (https://graph.microsoft.com/v1.0/ ). |
expirationDateTimeexpirationDateTime | dateTimedateTime | Obrigatório.Required. Especifica a data e a hora em que a assinatura do webhook expira.Specifies the date and time when the webhook subscription expires. O horário está em UTC e pode ser uma quantidade de tempo desde a criação da assinatura que varia para o recurso assinado.The time is in UTC, and can be an amount of time from subscription creation that varies for the resource subscribed to. Confira na tabela abaixo o tempo máximo permitido para a assinatura.See the table below for maximum supported subscription length of time. |
clientStateclientState | stringstring | Opcional.Optional. Especifica o valor da propriedade clientState enviada pelo serviço em cada notificação.Specifies the value of the clientState property sent by the service in each notification. O comprimento máximo é de 128 caracteres.The maximum length is 128 characters. O cliente pode verificar se a notificação foi proveniente do serviço comparando o valor da propriedade clientState enviada com a assinatura com o valor da propriedade clientState recebida com cada notificação.The client can check that the notification came from the service by comparing the value of the clientState property sent with the subscription with the value of the clientState property received with each notification. |
idid | stringstring | Identificador exclusivo da assinatura. Somente leitura.Unique identifier for the subscription. Read-only. |
ApplicationIdapplicationId | cadeia de caracteresstring | Identificador do aplicativo usado para criar a assinatura.Identifier of the application used to create the subscription. Somente leitura.Read-only. |
creatorIdcreatorId | cadeia de caracteresstring | Identificador de usuário ou entidade de serviço que criou a assinatura.Identifier of the user or service principal that created the subscription. Se o aplicativo usado delegada permissões para criar a assinatura, esse campo contém a id do usuário que entrou no aplicativo chamado em nome dele.If the app used delegated permissions to create the subscription, this field contains the id of the signed-in user the app called on behalf of. Se o aplicativo usou permissões do aplicativo, esse campo contém a id da entidade de serviço correspondente ao aplicativo.If the app used application permissions, this field contains the id of the service principal corresponding to the app. Somente leitura.Read-only. |
Tamanho máximo da assinatura por tipo de recursoMaximum length of subscription per resource type
RecursoResource | Tempo de Expiração MáximoMaximum Expiration Time |
---|---|
Usuário, grupo, outros recursos de diretórioUser, group, other directory resources | 4230 minutos (em 3 dias)4230 minutes (under 3 days) |
CorreioMail | 4230 minutos (em 3 dias)4230 minutes (under 3 days) |
CalendárioCalendar | 4230 minutos (em 3 dias)4230 minutes (under 3 days) |
ContatosContacts | 4230 minutos (em 3 dias)4230 minutes (under 3 days) |
Conversas em grupoGroup conversations | 4230 minutos (em 3 dias)4230 minutes (under 3 days) |
Itens raiz de unidadeDrive root items | 4230 minutos (em 3 dias)4230 minutes (under 3 days) |
Alertas de segurançaSecurity alerts | 43200 minutos (em 30 dias )43200 minutes (under 30 days) |
Observação: Os aplicativos existentes e os novos aplicativos não devem ultrapassar o valor suportado.Note: Existing applications and new applications should not exceed the supported value. No futuro, as solicitações para criar ou renovar uma assinatura além do valor máximo falharão.In the future, any requests to create or renew a subscription beyond the maximum value will fail.
RelaçõesRelationships
NenhumaNone
MétodosMethods
MétodoMethod | Tipo de retornoReturn Type | DescriçãoDescription |
---|---|---|
Criar assinaturaCreate subscription | subscriptionsubscription | Assina um aplicativo de escuta para receber notificações quando dados do Microsoft Graph são alterados.Subscribes a listener application to receive notifications when Microsoft Graph data changes. |
Atualizar assinaturaUpdate subscription | subscriptionsubscription | Renova uma assinatura atualizando seu tempo de expiração.Renews a subscription by updating its expiration time. |
Listar de assinaturasList subscriptions | assinaturasubscription | Lista assinaturas ativas.Lists active subscriptions. |
Obter assinaturaGet subscription | subscriptionsubscription | Lê as propriedades e as relações do objeto subscription.Reads properties and relationships of subscription object. |
Excluir assinaturaDelete subscription | NenhumaNone | Exclui um objeto assinatura.Deletes a subscription object. |