cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

FLOW HTTP Request to restore sharepoint major version

My requirement is to restore the Sharepoint List's last version of in case of some condition rejected in MS Flow. I got one document from Microsoft https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/listitemversion_restore?view=odsp-g... which states that there is some method to implement this :


 Method-1 POST /sites/{site-id}/lists/{list-id}/items/{item-id}/versions/{version-id}/restoreVersion
 Method-2 POST /sites/{site-id}/lists/{list-id}/items/{item-id}/versions/restoreVersion{version-id}

 

When I am using like below:


Method-1 _api/web/lists/getbytitle('XYZ_List')/items(81)/versions(22.0)/restoreVersion
Method-2 _api/web/lists/getbytitle('XYZ_List')/items(81)/versions/restoreByLabel('3.0')

 

I am getting the syntax error, Can anyone please help me with some working example of the function restoreVersion or restoreByLabel .

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Hi @ag0105,

 

Currently, restoreVersion api couldn't work for now. The version ID should be a number, not version label, you could use following api to get all versions, then you could find version ID in the output, for example:

Annotation 2020-07-17 131550.jpg

 

Cause restore not work for now, as a workaround, you could use this API to get the version, then using the output to update the item:

Annotation 2020-07-17 131455.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Highlighted
Community Support
Community Support

Hi @ag0105,

 

Currently, restoreVersion api couldn't work for now. The version ID should be a number, not version label, you could use following api to get all versions, then you could find version ID in the output, for example:

Annotation 2020-07-17 131550.jpg

 

Cause restore not work for now, as a workaround, you could use this API to get the version, then using the output to update the item:

Annotation 2020-07-17 131455.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (12,781)