An app can update an existing subscription by using the PATCH verb to change the properties of the subscription.
Note: Webhooks in OneDrive for Business are being rolling out to tenants over the next 2-3 weeks. If you are unable to create a subscription or receive a notification please try again in a few days.
To modify a subscription the app must have read-write access to the item the subscription exists on.
PATCH /drive/items/{item-id}/subscriptions/{id}
PATCH /drive/root:/{item-path}:/subscriptions/{id}
PATCH /drive/items/{item-id}/subscriptions/{id}
Content-Type: application/json
{
"notificationUrl": "https://contoso.azurewebsites.net/api/v2/webhook-receiver",
"expirationDateTime": "2016-01-03T11:23:00.000Z"
}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": "/drives/0/items/57705F13F13C3C0C!104",
"notificationUrl": "https://contoso.azurewebsites.net/api/v2/webhook-receiver",
"expirationDateTime": "2016-01-03T11:23:00.000Z",
"createdBy": { "application": {"id": "1291919111", "displayName": "Contoso App" } }
}See Error Responses for more info about how errors are returned.