我正在尝试使用Microsoft Graph API创建列表项到SharePoint endpoints . 我的网址如下:
https://graph.microsoft.com/v1.0/sites/{id}.sharepoint.com:/sites/{name of the site}:/lists/{list_id}/items
使用POST调用此URL,以及如下所示的正文:
{
"fields": {
"FileLeafRef": "757391.pdf",
"ContentType": "Document",
"Application_x0020_Name": "ABC",
}
}
这是错误的
“message”:“文件和文件夹只能通过OneDrive API添加到DocumentLibrary”
有人可以帮忙解决这个问题吗?
在这里,我尝试在列表中创建文档的元数据 .
1 回答
您无法上传文件(即在文档库中创建新的ListItem) . 您需要先使用OneDrive endpoints上传文件:
将文件放入文档库后,可以使用SharePoint endpoints更新现有文件中的元数据: