Anonymous
OneDrive SharedWithMe возвращает только один элемент
Сообщение
Anonymous » 14 янв 2026, 15:06
Запрос от автономного приложения к конечной точкеsharedWithMe возвращает только один элемент.
Для авторизации используются следующие области: files.readwrite.all group.readwrite.all site.readwrite.all offline_access user.read
При вызове той же конечной точки с помощью Graph Explorer возвращаются все общие элементы.
Результат из приложения:
Код: Выделить всё
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(microsoft.graph.driveItem)",
"value": [
{
"createdDateTime": "2025-11-13T18:48:46Z",
"id": "700DF30854FEF749!sd0cb731281c141acb1bf78fed133f933",
"lastModifiedDateTime": "2025-11-13T18:48:46Z",
"name": "saĝa-simio",
"webUrl": "https://onedrive.live.com?cid=700df30854fef749&id=700DF30854FEF749!sd0cb731281c141acb1bf78fed133f933",
"size": 0,
"createdBy": {
"user": {
"email": "outlook_700DF30854FEF749@outlook.com",
"id": "outlook_700DF30854FEF749@outlook.com",
"displayName": "Saĝa Simio"
}
},
"lastModifiedBy": {
"user": {
"email": "WISEAPE1968@GMAIL.COM",
"id": "WISEAPE1968@GMAIL.COM",
"displayName": "Saĝa Simio"
}
},
"fileSystemInfo": {
"createdDateTime": "2025-11-13T18:48:46Z",
"lastModifiedDateTime": "2025-11-13T18:48:46Z"
},
"folder": {
"childCount": 1,
"view": {}
},
"remoteItem": {
"createdDateTime": "2025-11-13T18:48:46Z",
"id": "700DF30854FEF749!sd0cb731281c141acb1bf78fed133f933",
"lastModifiedDateTime": "2025-11-13T18:48:46Z",
"name": "saĝa-simio",
"size": 0,
"createdBy": {
"user": {
"email": "outlook_700DF30854FEF749@outlook.com",
"id": "outlook_700DF30854FEF749@outlook.com",
"displayName": "Saĝa Simio"
}
},
"fileSystemInfo": {
"createdDateTime": "2025-11-13T18:48:46Z",
"lastModifiedDateTime": "2025-11-13T18:48:46Z"
},
"folder": {
"childCount": 1,
"view": {}
},
"lastModifiedBy": {
"user": {
"email": "WISEAPE1968@GMAIL.COM",
"id": "WISEAPE1968@GMAIL.COM",
"displayName": "Saĝa Simio"
}
},
"parentReference": {
"driveType": "personal",
"driveId": "700df30854fef749"
},
"shared": {
"scope": "users",
"sharedDateTime": "2025-11-13T19:16:19Z",
"owner": {
"user": {
"id": "700df30854fef749",
"displayName": "Saĝa Simio"
}
},
"sharedBy": {
"user": {
"email": "outlook_700DF30854FEF749@outlook.com",
"id": "outlook_700DF30854FEF749@outlook.com",
"displayName": "Saĝa Simio"
}
}
},
"sharepointIds": {
"listId": "a5aff78d-98ee-4b34-b35b-f4fe365ebd74",
"listItemId": "184",
"listItemUniqueId": "d0cb7312-81c1-41ac-b1bf-78fed133f933",
"siteId": "87dbe7ee-ae0c-4854-82e7-d56d982fef54",
"siteUrl": "https://my.microsoftpersonalcontent.com/personal/700df30854fef749",
"webId": "9d8b91c3-b0b9-45d1-83e4-17babde0d1dc"
}
}
}
]
}
Результат Graph Explorer:
Код: Выделить всё
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(microsoft.graph.driveItem)",
"@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET me/drive/microsoft.graph.sharedWithMe?$select=audio,bundle",
"value": [
{
"createdDateTime": "2025-11-13T18:48:46Z",
"id": "700DF30854FEF749!sd0cb731281c141acb1bf78fed133f933",
"lastModifiedDateTime": "2025-11-13T18:48:46Z",
"name": "saĝa-simio",
"webUrl": "https://onedrive.live.com?cid=700df30854fef749&id=700DF30854FEF749!sd0cb731281c141acb1bf78fed133f933",
"size": 0,
"createdBy": {
"user": {
"email": "outlook_700DF30854FEF749@outlook.com",
"id": "outlook_700DF30854FEF749@outlook.com",
"displayName": "Saĝa Simio"
}
},
"lastModifiedBy": {
"user": {
"email": "WISEAPE1968@GMAIL.COM",
"id": "WISEAPE1968@GMAIL.COM",
"displayName": "Saĝa Simio"
}
},
"fileSystemInfo": {
"createdDateTime": "2025-11-13T18:48:46Z",
"lastModifiedDateTime": "2025-11-13T18:48:46Z"
},
"folder": {
"childCount": 1,
"view": {}
},
"remoteItem": {
"createdDateTime": "2025-11-13T18:48:46Z",
"id": "700DF30854FEF749!sd0cb731281c141acb1bf78fed133f933",
"lastModifiedDateTime": "2025-11-13T18:48:46Z",
"name": "saĝa-simio",
"size": 0,
"createdBy": {
"user": {
"email": "outlook_700DF30854FEF749@outlook.com",
"id": "outlook_700DF30854FEF749@outlook.com",
"displayName": "Saĝa Simio"
}
},
"fileSystemInfo": {
"createdDateTime": "2025-11-13T18:48:46Z",
"lastModifiedDateTime": "2025-11-13T18:48:46Z"
},
"folder": {
"childCount": 1,
"view": {}
},
"lastModifiedBy": {
"user": {
"email": "WISEAPE1968@GMAIL.COM",
"id": "WISEAPE1968@GMAIL.COM",
"displayName": "Saĝa Simio"
}
},
"parentReference": {
"driveType": "personal",
"driveId": "700df30854fef749"
},
"shared": {
"scope": "users",
"sharedDateTime": "2025-11-13T19:16:19Z",
"owner": {
"user": {
"id": "700df30854fef749",
"displayName": "Saĝa Simio"
}
},
"sharedBy": {
"user": {
"email": "outlook_700DF30854FEF749@outlook.com",
"id": "outlook_700DF30854FEF749@outlook.com",
"displayName": "Saĝa Simio"
}
}
},
"sharepointIds": {
"listId": "a5aff78d-98ee-4b34-b35b-f4fe365ebd74",
"listItemId": "184",
"listItemUniqueId": "d0cb7312-81c1-41ac-b1bf-78fed133f933",
"siteId": "87dbe7ee-ae0c-4854-82e7-d56d982fef54",
"siteUrl": "https://my.microsoftpersonalcontent.com/personal/700df30854fef749",
"webId": "9d8b91c3-b0b9-45d1-83e4-17babde0d1dc"
}
}
},
{
"createdDateTime": "2025-11-13T18:24:59Z",
"id": "D26CADA368C1131F!116",
"lastModifiedDateTime": "2025-11-13T18:24:59Z",
"name": "Beastie",
"webUrl": "https://onedrive.live.com?cid=d26cada368c1131f&id=D26CADA368C1131F!116",
"size": 0,
"createdBy": {
"user": {
"email": "gracefulfaerie@outlook.com",
"id": "gracefulfaerie@outlook.com",
"displayName": "Faerie Graceful"
}
},
"lastModifiedBy": {
"user": {
"email": "GRACEFULFAERIE@OUTLOOK.COM",
"id": "GRACEFULFAERIE@OUTLOOK.COM",
"displayName": "Faerie Graceful"
}
},
"fileSystemInfo": {
"createdDateTime": "2025-11-13T18:24:59Z",
"lastModifiedDateTime": "2025-11-13T18:24:59Z"
},
"folder": {
"childCount": 1,
"view": {}
},
"remoteItem": {
"createdDateTime": "2025-11-13T18:24:59Z",
"id": "D26CADA368C1131F!116",
"lastModifiedDateTime": "2025-11-13T18:24:59Z",
"name": "Beastie",
"size": 0,
"createdBy": {
"user": {
"email": "gracefulfaerie@outlook.com",
"id": "gracefulfaerie@outlook.com",
"displayName": "Faerie Graceful"
}
},
"fileSystemInfo": {
"createdDateTime": "2025-11-13T18:24:59Z",
"lastModifiedDateTime": "2025-11-13T18:24:59Z"
},
"folder": {
"childCount": 1,
"view": {}
},
"lastModifiedBy": {
"user": {
"email": "GRACEFULFAERIE@OUTLOOK.COM",
"id": "GRACEFULFAERIE@OUTLOOK.COM",
"displayName": "Faerie Graceful"
}
},
"parentReference": {
"driveType": "personal",
"driveId": "d26cada368c1131f"
},
"shared": {
"scope": "users",
"sharedDateTime": "2025-11-13T18:41:30Z",
"owner": {
"user": {
"id": "d26cada368c1131f",
"displayName": "Faerie Graceful"
}
},
"sharedBy": {
"user": {
"email": "gracefulfaerie@outlook.com",
"id": "gracefulfaerie@outlook.com",
"displayName": "Faerie Graceful"
}
}
},
"sharepointIds": {
"listId": "5d31fd1e-38af-4117-b637-c1a0f7d5ca95",
"listItemId": "4",
"listItemUniqueId": "68c1131f-ada3-206c-80d2-740000000000",
"siteId": "74111012-f9e7-4940-ad60-5e53a21e2d3c",
"siteUrl": "https://my.microsoftpersonalcontent.com/personal/d26cada368c1131f",
"webId": "f1ea2ab8-b5ee-4c93-8ce2-6c12700c226a"
}
}
}
]
}
Минимальное приложение C++ (с использованием cpprestsdk):
Код: Выделить всё
#include
#include
#include
#include
int main()
{
try {
web::http::uri uri{ "https://graph.microsoft.com/v1.0/me/drive/sharedwithMe" };
web::http::client::http_client client{ uri };
web::http::http_request request{ web::http::methods::GET };
request.headers().add("Authorization", "Bearer [redacted]");
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79826516/onedrive-sharedwithme-returns-only-one-item[/url]
1768392393
Anonymous
Запрос от автономного приложения к конечной точкеsharedWithMe возвращает только один элемент. Для авторизации используются следующие области: files.readwrite.all group.readwrite.all site.readwrite.all offline_access user.read При вызове той же конечной точки с помощью Graph Explorer возвращаются все общие элементы. Результат из приложения: [code]{ "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(microsoft.graph.driveItem)", "value": [ { "createdDateTime": "2025-11-13T18:48:46Z", "id": "700DF30854FEF749!sd0cb731281c141acb1bf78fed133f933", "lastModifiedDateTime": "2025-11-13T18:48:46Z", "name": "saĝa-simio", "webUrl": "https://onedrive.live.com?cid=700df30854fef749&id=700DF30854FEF749!sd0cb731281c141acb1bf78fed133f933", "size": 0, "createdBy": { "user": { "email": "outlook_700DF30854FEF749@outlook.com", "id": "outlook_700DF30854FEF749@outlook.com", "displayName": "Saĝa Simio" } }, "lastModifiedBy": { "user": { "email": "WISEAPE1968@GMAIL.COM", "id": "WISEAPE1968@GMAIL.COM", "displayName": "Saĝa Simio" } }, "fileSystemInfo": { "createdDateTime": "2025-11-13T18:48:46Z", "lastModifiedDateTime": "2025-11-13T18:48:46Z" }, "folder": { "childCount": 1, "view": {} }, "remoteItem": { "createdDateTime": "2025-11-13T18:48:46Z", "id": "700DF30854FEF749!sd0cb731281c141acb1bf78fed133f933", "lastModifiedDateTime": "2025-11-13T18:48:46Z", "name": "saĝa-simio", "size": 0, "createdBy": { "user": { "email": "outlook_700DF30854FEF749@outlook.com", "id": "outlook_700DF30854FEF749@outlook.com", "displayName": "Saĝa Simio" } }, "fileSystemInfo": { "createdDateTime": "2025-11-13T18:48:46Z", "lastModifiedDateTime": "2025-11-13T18:48:46Z" }, "folder": { "childCount": 1, "view": {} }, "lastModifiedBy": { "user": { "email": "WISEAPE1968@GMAIL.COM", "id": "WISEAPE1968@GMAIL.COM", "displayName": "Saĝa Simio" } }, "parentReference": { "driveType": "personal", "driveId": "700df30854fef749" }, "shared": { "scope": "users", "sharedDateTime": "2025-11-13T19:16:19Z", "owner": { "user": { "id": "700df30854fef749", "displayName": "Saĝa Simio" } }, "sharedBy": { "user": { "email": "outlook_700DF30854FEF749@outlook.com", "id": "outlook_700DF30854FEF749@outlook.com", "displayName": "Saĝa Simio" } } }, "sharepointIds": { "listId": "a5aff78d-98ee-4b34-b35b-f4fe365ebd74", "listItemId": "184", "listItemUniqueId": "d0cb7312-81c1-41ac-b1bf-78fed133f933", "siteId": "87dbe7ee-ae0c-4854-82e7-d56d982fef54", "siteUrl": "https://my.microsoftpersonalcontent.com/personal/700df30854fef749", "webId": "9d8b91c3-b0b9-45d1-83e4-17babde0d1dc" } } } ] } [/code] Результат Graph Explorer: [code]{ "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(microsoft.graph.driveItem)", "@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET me/drive/microsoft.graph.sharedWithMe?$select=audio,bundle", "value": [ { "createdDateTime": "2025-11-13T18:48:46Z", "id": "700DF30854FEF749!sd0cb731281c141acb1bf78fed133f933", "lastModifiedDateTime": "2025-11-13T18:48:46Z", "name": "saĝa-simio", "webUrl": "https://onedrive.live.com?cid=700df30854fef749&id=700DF30854FEF749!sd0cb731281c141acb1bf78fed133f933", "size": 0, "createdBy": { "user": { "email": "outlook_700DF30854FEF749@outlook.com", "id": "outlook_700DF30854FEF749@outlook.com", "displayName": "Saĝa Simio" } }, "lastModifiedBy": { "user": { "email": "WISEAPE1968@GMAIL.COM", "id": "WISEAPE1968@GMAIL.COM", "displayName": "Saĝa Simio" } }, "fileSystemInfo": { "createdDateTime": "2025-11-13T18:48:46Z", "lastModifiedDateTime": "2025-11-13T18:48:46Z" }, "folder": { "childCount": 1, "view": {} }, "remoteItem": { "createdDateTime": "2025-11-13T18:48:46Z", "id": "700DF30854FEF749!sd0cb731281c141acb1bf78fed133f933", "lastModifiedDateTime": "2025-11-13T18:48:46Z", "name": "saĝa-simio", "size": 0, "createdBy": { "user": { "email": "outlook_700DF30854FEF749@outlook.com", "id": "outlook_700DF30854FEF749@outlook.com", "displayName": "Saĝa Simio" } }, "fileSystemInfo": { "createdDateTime": "2025-11-13T18:48:46Z", "lastModifiedDateTime": "2025-11-13T18:48:46Z" }, "folder": { "childCount": 1, "view": {} }, "lastModifiedBy": { "user": { "email": "WISEAPE1968@GMAIL.COM", "id": "WISEAPE1968@GMAIL.COM", "displayName": "Saĝa Simio" } }, "parentReference": { "driveType": "personal", "driveId": "700df30854fef749" }, "shared": { "scope": "users", "sharedDateTime": "2025-11-13T19:16:19Z", "owner": { "user": { "id": "700df30854fef749", "displayName": "Saĝa Simio" } }, "sharedBy": { "user": { "email": "outlook_700DF30854FEF749@outlook.com", "id": "outlook_700DF30854FEF749@outlook.com", "displayName": "Saĝa Simio" } } }, "sharepointIds": { "listId": "a5aff78d-98ee-4b34-b35b-f4fe365ebd74", "listItemId": "184", "listItemUniqueId": "d0cb7312-81c1-41ac-b1bf-78fed133f933", "siteId": "87dbe7ee-ae0c-4854-82e7-d56d982fef54", "siteUrl": "https://my.microsoftpersonalcontent.com/personal/700df30854fef749", "webId": "9d8b91c3-b0b9-45d1-83e4-17babde0d1dc" } } }, { "createdDateTime": "2025-11-13T18:24:59Z", "id": "D26CADA368C1131F!116", "lastModifiedDateTime": "2025-11-13T18:24:59Z", "name": "Beastie", "webUrl": "https://onedrive.live.com?cid=d26cada368c1131f&id=D26CADA368C1131F!116", "size": 0, "createdBy": { "user": { "email": "gracefulfaerie@outlook.com", "id": "gracefulfaerie@outlook.com", "displayName": "Faerie Graceful" } }, "lastModifiedBy": { "user": { "email": "GRACEFULFAERIE@OUTLOOK.COM", "id": "GRACEFULFAERIE@OUTLOOK.COM", "displayName": "Faerie Graceful" } }, "fileSystemInfo": { "createdDateTime": "2025-11-13T18:24:59Z", "lastModifiedDateTime": "2025-11-13T18:24:59Z" }, "folder": { "childCount": 1, "view": {} }, "remoteItem": { "createdDateTime": "2025-11-13T18:24:59Z", "id": "D26CADA368C1131F!116", "lastModifiedDateTime": "2025-11-13T18:24:59Z", "name": "Beastie", "size": 0, "createdBy": { "user": { "email": "gracefulfaerie@outlook.com", "id": "gracefulfaerie@outlook.com", "displayName": "Faerie Graceful" } }, "fileSystemInfo": { "createdDateTime": "2025-11-13T18:24:59Z", "lastModifiedDateTime": "2025-11-13T18:24:59Z" }, "folder": { "childCount": 1, "view": {} }, "lastModifiedBy": { "user": { "email": "GRACEFULFAERIE@OUTLOOK.COM", "id": "GRACEFULFAERIE@OUTLOOK.COM", "displayName": "Faerie Graceful" } }, "parentReference": { "driveType": "personal", "driveId": "d26cada368c1131f" }, "shared": { "scope": "users", "sharedDateTime": "2025-11-13T18:41:30Z", "owner": { "user": { "id": "d26cada368c1131f", "displayName": "Faerie Graceful" } }, "sharedBy": { "user": { "email": "gracefulfaerie@outlook.com", "id": "gracefulfaerie@outlook.com", "displayName": "Faerie Graceful" } } }, "sharepointIds": { "listId": "5d31fd1e-38af-4117-b637-c1a0f7d5ca95", "listItemId": "4", "listItemUniqueId": "68c1131f-ada3-206c-80d2-740000000000", "siteId": "74111012-f9e7-4940-ad60-5e53a21e2d3c", "siteUrl": "https://my.microsoftpersonalcontent.com/personal/d26cada368c1131f", "webId": "f1ea2ab8-b5ee-4c93-8ce2-6c12700c226a" } } } ] } [/code] Минимальное приложение C++ (с использованием cpprestsdk): [code]#include #include #include #include int main() { try { web::http::uri uri{ "https://graph.microsoft.com/v1.0/me/drive/sharedwithMe" }; web::http::client::http_client client{ uri }; web::http::http_request request{ web::http::methods::GET }; request.headers().add("Authorization", "Bearer [redacted]"); std::cout Подробнее здесь: [url]https://stackoverflow.com/questions/79826516/onedrive-sharedwithme-returns-only-one-item[/url]