Skip to content
This repository was archived by the owner on Dec 2, 2017. It is now read-only.

Latest commit

 

History

History
72 lines (56 loc) · 1.94 KB

File metadata and controls

72 lines (56 loc) · 1.94 KB

Updating a subscription

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.

Prerequisites

To modify a subscription the app must have read-write access to the item the subscription exists on.

HTTP request

PATCH /drive/items/{item-id}/subscriptions/{id}
PATCH /drive/root:/{item-path}:/subscriptions/{id}

Example

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"
}

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": "/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" } }
}

Error responses

See Error Responses for more info about how errors are returned.