Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,685 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I need to add file attachment to a genericlist item .
On Graph api explorer I can see tha Item contains attacments but I cannot explore them.
And how can add attachment via Graph Api ? I can only do that via browser on the list item detail.
I try to do that
MemoryStream mem = ConvertBase64ToMemoryStream(attachmentFiletxt); //new MemoryStream(fileBytes);
var res = await _appClient
.Sites[siteId]
.Lists[listId]
.Items[itemId]
.DriveItem
.Content
.PutAsync(mem);
but the response is " Cannot request driveItem for an item that is not in a document library"
Is there another way to do that ?
thans