使用oauth2.0成功生成访问令牌后,将文件/文件夹上传到Web应用程序中的onedrive /共享点

时间:2019-04-05 08:33:43

标签: c# sharepoint onedrive

使用Oauth 2.0,我已授权用户,获取访问令牌和刷新令牌,并使用访问令牌将文件上传到一个驱动器

1 个答案:

答案 0 :(得分:0)

关于此主题有很多官方文档。

这是Downloading a file的文档 您可以在其中查看:

GET /drives/{drive-id}/items/{item-id}/content
GET /groups/{group-id}/drive/items/{item-id}/content
GET /me/drive/root:/{item-path}:/content
GET /me/drive/items/{item-id}/content
GET /sites/{siteId}/drive/items/{item-id}/content
GET /users/{userId}/drive/items/{item-id}/content

this is for Uploading

HTTP请求(用于替换现有项目)

PUT /drives/{drive-id}/items/{item-id}/content
PUT /groups/{group-id}/drive/items/{item-id}/content
PUT /me/drive/items/{item-id}/content
PUT /sites/{site-id}/drive/items/{item-id}/content
PUT /users/{user-id}/drive/items/{item-id}/content

HTTP请求(上传新文件) HTTP

PUT /drives/{drive-id}/items/{parent-id}:/{filename}:/content
PUT /groups/{group-id}/drive/items/{parent-id}:/{filename}:/content
PUT /me/drive/items/{parent-id}:/{filename}:/content
PUT /sites/{site-id}/drive/items/{parent-id}:/{filename}:/content
PUT /users/{user-id}/drive/items/{parent-id}:/{filename}:/content

这也是documentation about DrivesDriveItems