Forum Discussion

Si_Da's avatar
Si_Da
Brass Contributor
Apr 10, 2019
Solved

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 u...
  • Si_Da's avatar
    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).

     

Resources