Update subscription
Renew a subscription by extending its expiry time.
Subscriptions to resources expire at dates proscribed by the individual resource types. In order not to miss notifications, subscriptions should be renewed well in advance of their expiry date. See subscription for individual expiry dates.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
Permission type | Permissions (from least to most privileged) |
---|---|
Delegated (work or school account) | Files.Read, Files.ReadWrite, Files.Read.All, Files.ReadWrite.All, Sites.Read.All, Sites.ReadWrite.All |
Delegated (personal Microsoft account) | Files.Read, Files.ReadWrite, Files.Read.All, Files.ReadWrite.All |
Application | Files.Read.All, Files.ReadWrite.All, Sites.Read.All, Sites.ReadWrite.All |
HTTP request
PATCH /subscriptions/{id}
Example
Request
PATCH /subscriptions/{id}
Content-type: application/json
{
"expirationDateTime": "2018-01-03T11:23:00.000Z"
}
Response
If the subscription is patched successfully then the resulting subscription object is returned:
HTTP/1.1 200 OK
Content-type: application/json
{
"id": "1039149811asbc",
"resource": "/me/drive/root",
"changeType": "updated",
"clientState": "subscription-identifier",
"notificationUrl": "https://contoso.azurewebsites.net/api/v2/webhook-receiver",
"expirationDateTime": "2018-01-03T11:23:00.000Z"
}
Error responses
See Error Responses for more info about how errors are returned.