I am trying to create list items with Microsoft Graph API to a SharePoint endpoint. My URL is as follows:
https://graph.microsoft.com/v1.0/sites/{id}.sharepoint.com:/sites/{name of the site}:/lists/{list_id}/items
Calling this URL with POST, and a body like this:
{
"fields": {
"FileLeafRef": "757391.pdf",
"ContentType": "Document",
"Application_x0020_Name": "ABC",
}
}
It is giving error as
"message": "Files and folders should only be added to a DocumentLibrary via the OneDrive API"
Can some one help on this, how to fix this issue?
Here I am trying to create metadata for document, with in a list.