mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-19 06:06:34 +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;
|
auto expirationDateTime = Clock.currTime(UTC()) + subscriptionExpirationInterval;
|
||||||
const(char)[] url;
|
const(char)[] url;
|
||||||
url = subscriptionUrl;
|
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 = [
|
const JSONValue request = [
|
||||||
"changeType": "updated",
|
"changeType": "updated",
|
||||||
"notificationUrl": notificationUrl,
|
"notificationUrl": notificationUrl,
|
||||||
"resource": "/me/drive/root",
|
"resource": resourceItem,
|
||||||
"expirationDateTime": expirationDateTime.toISOExtString(),
|
"expirationDateTime": expirationDateTime.toISOExtString(),
|
||||||
"clientState": randomUUID().toString()
|
"clientState": randomUUID().toString()
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue