Forum Discussion
Example of a Sharepoint document Version ID...?
- Apr 10, 2019
OK I think I've answered my own question but posting for anyone else trying to do this....
My problem was not with the ID but with the REST I was using. For example:
{BaseURL}/sites/{SiteName}/_api/web/GetFileByServerRelativeUrl('/sites/{SiteName}/Shared%20Documents/{FilenameAndPath}')/versions/{VersionID}
Should be:
{BaseURL}/sites/{SiteName}/_api/web/GetFileByServerRelativeUrl('/sites/{SiteName}/Shared%20Documents/{FilenameAndPath}')/versions({VersionID})
Although strangely I got the original (incorrect) one directly from Microsofts own documentation!
The version IDs are 3-4 digits long (at least mine are).
OK I think I've answered my own question but posting for anyone else trying to do this....
My problem was not with the ID but with the REST I was using. For example:
{BaseURL}/sites/{SiteName}/_api/web/GetFileByServerRelativeUrl('/sites/{SiteName}/Shared%20Documents/{FilenameAndPath}')/versions/{VersionID}
Should be:
{BaseURL}/sites/{SiteName}/_api/web/GetFileByServerRelativeUrl('/sites/{SiteName}/Shared%20Documents/{FilenameAndPath}')/versions({VersionID})
Although strangely I got the original (incorrect) one directly from Microsofts own documentation!
The version IDs are 3-4 digits long (at least mine are).