문제

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.

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top