mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-02 14:12:52 +02:00
Fix webhook subscription creation for SharePoint Libraries (#2339)
* Fix webhook subscription creation for SharePoint Libraries
This commit is contained in:
parent
52b1276282
commit
6607ba537b
|
@ -1012,10 +1012,19 @@ final class OneDriveApi
|
|||
auto expirationDateTime = Clock.currTime(UTC()) + subscriptionExpirationInterval;
|
||||
const(char)[] url;
|
||||
url = subscriptionUrl;
|
||||
// Create a resource item based on if we have a driveId
|
||||
string resourceItem;
|
||||
if (driveId.length) {
|
||||
resourceItem = "/drives/" ~ driveId ~ "/root";
|
||||
} else {
|
||||
resourceItem = "/me/drive/root";
|
||||
}
|
||||
|
||||
// create JSON request to create webhook subscription
|
||||
const JSONValue request = [
|
||||
"changeType": "updated",
|
||||
"notificationUrl": notificationUrl,
|
||||
"resource": "/me/drive/root",
|
||||
"resource": resourceItem,
|
||||
"expirationDateTime": expirationDateTime.toISOExtString(),
|
||||
"clientState": randomUUID().toString()
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue