Events: watch
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Fique de olho nas mudanças nos recursos de eventos.
Solicitação
Solicitação HTTP
POST https://www.googleapis.com/calendar/v3/calendars/calendarId/events/watch
Parâmetros
Nome do parâmetro |
Valor |
Descrição |
Parâmetros de caminho |
calendarId |
string |
Identificador da agenda. Para extrair os IDs de agenda, chame o método calendarList.list. Se você quiser acessar a agenda principal do usuário conectado, use a palavra-chave primary .
|
Parâmetros de consulta opcionais |
eventTypes |
string |
Tipos de eventos de recursos a serem monitorados. Opcional. Esse parâmetro pode ser repetido várias vezes para monitorar recursos de tipos diferentes. Se não for definido, todos os tipos de evento serão retornados.
Os valores aceitáveis são:
- "
birthday ": eventos especiais de dia inteiro com recorrência anual.
- "
default ": eventos regulares.
- "
focusTime ": eventos "Hora de se concentrar".
- "
fromGmail ": eventos do Gmail.
- "
outOfOffice ": eventos fora do escritório.
- "
workingLocation ": eventos de local de trabalho.
|
Autorização
Esta solicitação permite a autorização com pelo menos um dos seguintes escopos:
Escopo |
https://www.googleapis.com/auth/calendar.readonly |
https://www.googleapis.com/auth/calendar |
https://www.googleapis.com/auth/calendar.events.readonly |
https://www.googleapis.com/auth/calendar.events |
https://www.googleapis.com/auth/calendar.app.created |
https://www.googleapis.com/auth/calendar.events.freebusy |
https://www.googleapis.com/auth/calendar.events.owned |
https://www.googleapis.com/auth/calendar.events.owned.readonly |
https://www.googleapis.com/auth/calendar.events.public.readonly |
Para mais informações, consulte a página de autenticação e autorização.
Corpo da solicitação
No corpo da solicitação, forneça os dados com a seguinte estrutura:
{
"id": string,
"token": string,
"type": string,
"address": string,
"params": {
"ttl": string
}
}
Nome da propriedade |
Valor |
Descrição |
Observações |
id |
string |
Um UUID ou string exclusiva semelhante que identifica esse canal. |
|
token |
string |
Uma string arbitrária entregue ao endereço de destino com cada notificação enviada por esse canal. Opcional. |
|
type |
string |
O tipo de mecanismo de entrega usado para esse canal. Os valores válidos são "web_hook " (ou "webhook "). Ambos os valores se referem a um canal em que as solicitações HTTP são usadas para enviar mensagens. |
|
address |
string |
O endereço para onde as notificações são enviadas para este canal. |
|
params |
object |
Parâmetros adicionais que controlam o comportamento do canal de entrega. Opcional. |
|
params.ttl |
string |
O tempo de vida em segundos do canal de notificação. O padrão é 604800 segundos. |
|
Resposta
Se for bem-sucedido, esse método retornará um corpo de resposta com esta estrutura:
{
"kind": "api#channel",
"id": string,
"resourceId": string,
"resourceUri": string,
"token": string,
"expiration": long
}
Nome da propriedade |
Valor |
Descrição |
Observações |
kind |
string |
Identifica isso como um canal de notificação usado para detectar mudanças em um recurso, que é "api#channel ". |
|
id |
string |
Um UUID ou string exclusiva semelhante que identifica esse canal. |
|
resourceId |
string |
Um ID opaco que identifica o recurso que está sendo assistido neste canal. Estável em diferentes versões da API. |
|
resourceUri |
string |
Um identificador específico da versão para o recurso monitorado. |
|
token |
string |
Uma string arbitrária entregue ao endereço de destino com cada notificação enviada por esse canal. Opcional. |
|
expiration |
long |
Data e hora de expiração do canal de notificação, expressa como um carimbo de data/hora Unix, em milissegundos. Opcional. |
|
Exceto em caso de indicação contrária, o conteúdo desta página é licenciado de acordo com a Licença de atribuição 4.0 do Creative Commons, e as amostras de código são licenciadas de acordo com a Licença Apache 2.0. Para mais detalhes, consulte as políticas do site do Google Developers. Java é uma marca registrada da Oracle e/ou afiliadas.
Última atualização 2025-07-25 UTC.
[null,null,["Última atualização 2025-07-25 UTC."],[],[],null,["# Events: watch\n\n| **Note:** [Authorization](#auth) optional.\n\nWatch for changes to Events resources.\n\nRequest\n-------\n\n### HTTP request\n\n```\nPOST https://www.googleapis.com/calendar/v3/calendars/calendarId/events/watch\n```\n\n### Parameters\n\n| Parameter name | Value | Description |\n|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Path parameters** |||\n| `calendarId` | `string` | Calendar identifier. To retrieve calendar IDs call the [calendarList.list](/workspace/calendar/api/v3/reference/calendarList/list) method. If you want to access the primary calendar of the currently logged in user, use the \"`primary`\" keyword. |\n| **Optional query parameters** |||\n| `eventTypes` | `string` | Event types of resources to watch. Optional. This parameter can be repeated multiple times to watch resources of different types. If unset, returns all event types. \u003cbr /\u003e \u003cbr /\u003e Acceptable values are: - \"`birthday`\": Special all-day events with an annual recurrence. - \"`default`\": Regular events. - \"`focusTime`\": Focus time events. - \"`fromGmail`\": Events from Gmail. - \"`outOfOffice`\": Out of office events. - \"`workingLocation`\": Working location events. |\n\n### Authorization\n\nThis request allows authorization with at least one of the following scopes:\n\n| Scope |\n|-------------------------------------------------------------------|\n| `https://www.googleapis.com/auth/calendar.readonly` |\n| `https://www.googleapis.com/auth/calendar` |\n| `https://www.googleapis.com/auth/calendar.events.readonly` |\n| `https://www.googleapis.com/auth/calendar.events` |\n| `https://www.googleapis.com/auth/calendar.app.created` |\n| `https://www.googleapis.com/auth/calendar.events.freebusy` |\n| `https://www.googleapis.com/auth/calendar.events.owned` |\n| `https://www.googleapis.com/auth/calendar.events.owned.readonly` |\n| `https://www.googleapis.com/auth/calendar.events.public.readonly` |\n\nFor more information, see the [authentication and authorization](/workspace/guides/configure-oauth-consent) page.\n\n### Request body\n\nIn the request body, supply data with the following structure:\n\n```carbon\n{\n \"id\": string,\n \"token\": string,\n \"type\": string,\n \"address\": string,\n \"params\": {\n \"ttl\": string\n }\n}\n```\n\n| Property name | Value | Description | Notes |\n|---------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------|\n| `id` | `string` | A UUID or similar unique string that identifies this channel. | |\n| `token` | `string` | An arbitrary string delivered to the target address with each notification delivered over this channel. Optional. | |\n| `type` | `string` | The type of delivery mechanism used for this channel. Valid values are \"`web_hook`\" (or \"`webhook`\"). Both values refer to a channel where Http requests are used to deliver messages. | |\n| `address` | `string` | The address where notifications are delivered for this channel. | |\n| `params` | `object` | Additional parameters controlling delivery channel behavior. Optional. | |\n| params.`ttl` | `string` | The time-to-live in seconds for the notification channel. Default is 604800 seconds. | |\n\nResponse\n--------\n\nIf successful, this method returns a response body with the following structure:\n\n```text\n{\n \"kind\": \"api#channel\",\n \"id\": string,\n \"resourceId\": string,\n \"resourceUri\": string,\n \"token\": string,\n \"expiration\": long\n}\n```\n\n| Property name | Value | Description | Notes |\n|---------------|----------|-------------------------------------------------------------------------------------------------------------------|-------|\n| `kind` | `string` | Identifies this as a notification channel used to watch for changes to a resource, which is \"`api#channel`\". | |\n| `id` | `string` | A UUID or similar unique string that identifies this channel. | |\n| `resourceId` | `string` | An opaque ID that identifies the resource being watched on this channel. Stable across different API versions. | |\n| `resourceUri` | `string` | A version-specific identifier for the watched resource. | |\n| `token` | `string` | An arbitrary string delivered to the target address with each notification delivered over this channel. Optional. | |\n| `expiration` | `long` | Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional. | |"]]