Domanda

I'm trying to update the moderation status of a sharepoint file through rest API. The rest API will be called from java code.I'm trying to update it using a HTTP patch request for graph api.I'm using the below API

https://graph.microsoft.com/v1.0/sites/{site}/drives/{driveId}/items/{itenId}/listitem

and my payload is

{  
    "_ModerationStatus" : 0  
}

The status is getting updated but it reverts back to pending as a new version is created.

I have versioning turned on my document library. Is there any way to update the moderation status without it rolling back to pending.

**Note:**I need versioning on my library. So, the versioning setting cannot be turned off.

È stato utile?

Soluzione

The Graph API doesn't have an exact equivalent, but the SharePoint REST API specifically has an Approve method on the File object: https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-rest-reference/dn450841(v%3doffice.15)#approve

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top