Forum Discussion
Example of a Sharepoint document Version ID...?
I did a REST call to get a list of the versions of a document but can't determine which is the Version ID. I've tried using various things but nothing is recognised when I try and do a GET Version using the Version ID as an input parameter. I've attached an image of the results, can anyone advise please?
Also I noticed that this is only returning previous versions not the current version, I would have expected it to return all versions.
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).
1 Reply
- Si_DaBrass Contributor
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).