Можно ли использовать пакетную конечную точку API-интерфейса rest graph microsoft для загрузки файлов> 4 Мб? Я получаю ошибку. Я также попытался изменить URL-адрес для запроса графика: {domain} .sharepoint.com / sites / {sitename} / _ api / v2.0 / $ batch, но получил ту же ошибку.
См. ниже запрос и ошибка
График запроса
POST /$batch HTTP/1.1
Host: https://graph.microsoft.com/beta
Content-Type: application/json
Authorization: Bearer {token}
{
"requests": [
{
"id": "1",
"url": "/drives/{drive-id}/items/{item-id}/uploadSession?guid='{guid}'&path='test1.pdf'&overwrite=True&rename=False&dc=0&tempauth={token}",
"method": "PUT",
"body": "MQ==",
"headers": {
"Content-Type": "text/plain",
"Content-Range": "bytes 0-0/1"
}
},
{
"id": "2",
"url": "/drives/{drive-id}/items/{item-id}/uploadSession?guid='{guid}'&path='test2.pdf'&overwrite=True&rename=False&dc=0&tempauth={token}",
"method": "PUT",
"body": "MQ==",
"headers": {
"Content-Type": "text/plain",
"Content-Range": "bytes 0-0/1"
}
}
]
}
График ответа
{"error":{"innerError":{"code":"invalidSignature"},"code":"unauthenticated","message":"Token contains invalid signature."}}
Запрос авторизации
POST /{tenant-id}/oauth2/v2.0/token HTTP/1.1
Host: https://login.microsoftonline.com
Content-Type: application/x-www-form-urlencoded
client_id={client-id}&scope=https://graph.microsoft.com/.default&client_secret={client-secret}&grant_type=client_credentials