Settings: watch
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Controlla le modifiche alle risorse delle impostazioni.
Richiesta
Richiesta HTTP
POST https://www.googleapis.com/calendar/v3/users/me/settings/watch
Parametri
Nome del parametro |
Valore |
Descrizione |
Autorizzazione
Questa richiesta richiede l'autorizzazione con almeno uno dei seguenti ambiti:
Ambito |
https://www.googleapis.com/auth/calendar.readonly |
https://www.googleapis.com/auth/calendar |
https://www.googleapis.com/auth/calendar.settings.readonly |
Per ulteriori informazioni, consulta la pagina Autenticazione e autorizzazione.
Corpo della richiesta
Nel corpo della richiesta, fornisci i dati con la seguente struttura:
{
"id": string,
"token": string,
"type": string,
"address": string,
"params": {
"ttl": string
}
}
Nome proprietà |
Valore |
Descrizione |
Note |
id |
string |
Un UUID o una stringa univoca simile che identifica questo canale. |
|
token |
string |
Una stringa arbitraria inviata all'indirizzo di destinazione con ogni notifica inviata su questo canale. (Facoltativo) |
|
type |
string |
Il tipo di meccanismo di pubblicazione utilizzato per questo canale. I valori validi sono "web_hook " (o "webhook "). Entrambi i valori fanno riferimento a un canale in cui le richieste HTTP vengono utilizzate per recapitare i messaggi. |
|
address |
string |
L'indirizzo a cui vengono recapitate le notifiche per questo canale. |
|
params |
object |
Parametri aggiuntivi che controllano il comportamento del canale di pubblicazione. (Facoltativo) |
|
params.ttl |
string |
La durata in secondi del canale di notifica. Il valore predefinito è 604.800 secondi. |
|
Risposta
In caso di esito positivo, questo metodo restituisce un corpo della risposta con la seguente struttura:
{
"kind": "api#channel",
"id": string,
"resourceId": string,
"resourceUri": string,
"token": string,
"expiration": long
}
Nome proprietà |
Valore |
Descrizione |
Note |
kind |
string |
Identifica come un canale di notifica utilizzato per controllare le modifiche a una risorsa, "api#channel ". |
|
id |
string |
Un UUID o una stringa univoca simile che identifica questo canale. |
|
resourceId |
string |
Un ID opaco che identifica la risorsa guardata su questo canale. Stabile su diverse versioni dell'API. |
|
resourceUri |
string |
Un identificatore specifico della versione per la risorsa controllata. |
|
token |
string |
Una stringa arbitraria inviata all'indirizzo di destinazione con ogni notifica inviata su questo canale. (Facoltativo) |
|
expiration |
long |
Data e ora di scadenza del canale di notifica, espresse come timestamp Unix, in millisecondi. (Facoltativo) |
|
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-25 UTC.
[null,null,["Ultimo aggiornamento 2025-07-25 UTC."],[],[],null,["# Settings: watch\n\n| **Note:** Requires [authorization](#auth).\n\nWatch for changes to Settings resources.\n\nRequest\n-------\n\n### HTTP request\n\n```\nPOST https://www.googleapis.com/calendar/v3/users/me/settings/watch\n```\n\n### Parameters\n\n| Parameter name | Value | Description |\n|----------------|-------|-------------|\n\n### Authorization\n\nThis request requires 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.settings.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. | |"]]