Check a file in as major version
How to check a file in as major version to a SharePoint Online document library using a Power Automate flow.
URI
_api/web/getfilebyserverrelativeurl('/sites/@{variables('SiteName')}/@{variables('DocumentLibraryName')}/@{variables('FileNameWithExtension')}')/checkin(comment='Bulk Publish',checkintype=1) |
Headers
{ | |
"Accept": "application/json;odata=verbose", | |
"Content-Type": "application/json;odata=verbose" | |
} |
Body
Not applicable
Screenshot with example
Sample data
SiteName – PowerUsers
DocumentLibraryName – Bulk Publish
FileNameWithExtension – Test2.docx
Copy/paste example
{"id":"d9aab874-e1d1-43b4-ace7-485fb63e6494","brandColor":"#036C70","connectionReferences":{"shared_sharepointonline":{"connection":{"id":"/exp_sharedsharepointonline_e5efa"}}},"connectorDisplayName":"SharePoint","icon":"https://connectoricons-prod.azureedge.net/u/juanq/gateway/greyhound/3000.150.11/1.0.1613.3116/sharepointonline/icon.png","isTrigger":false,"operationName":"Send_an_HTTP_request_to_SharePoint","operationDefinition":{"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_sharepointonline","operationId":"HttpRequest","apiId":"/providers/Microsoft.PowerApps/apis/shared_sharepointonline"},"parameters":{"dataset":"@parameters('SPOSiteCollection_PowerUsers (exp_SPOSiteCollection_PowerUsers)')","parameters/method":"POST","parameters/uri":"_api/web/getfilebyserverrelativeurl('/sites/@{variables('SiteName')}/@{variables('DocumentLibraryName')}/@{variables('FileNameWithExtension')}')/checkin(comment='Bulk Publish',checkintype=1)","parameters/headers":{"Accept":"application/json;odata=verbose","Content-Type":"application/json;odata=verbose"}},"authentication":{"type":"Raw","value":"@json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$ConnectionKey']"}},"runAfter":{"Send_an_HTTP_request_to_SharePoint_-_Checkout":["Succeeded"]},"metadata":{"operationMetadataId":"28a912f1-0d62-423c-adf4-5ed442229f8a"}}} |
Resources
That’s it, Happy testing!