1
votes

I have been searching and can't seem to find the answer. I have a list in SharePoint, which is a Document Library, and I have associated a Content Type with specific fields to that Document Library.

In SharePoint, if I view the properties of a document in the Document Library, I can view and update the values for the fields associated with the Content Type. However using the Microsoft Graph API as instructed here for GET and here for UPDATE, I cannot get or update these Content Type related properties for the document, using the following.

GET https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items/{item-id}

or

PATCH https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items/{item-id}

I have all the right permissions because I am able to get and update the normal fields on the document. I am just unable to do so for fields associated with the Content Type.

Is there a way to do this with Microsoft Graph that I'm not finding?

1

1 Answers

0
votes

You can set your Content Type fields in the Request Body

{
    "fields": {
        "{Field Name}": "{Value}"
    }
}

Just ensure you use the Internal Field name of the SP field. Credit to Brett McKenzie and this post Updating a SharePoint List Item’s Content Type in the Microsoft Graph