none
Is it possible to get Version History Of SharePoint online List Items using REST ? RRS feed

  • Question

  • Is there a way to retrieve versions of calendar list items in sharepoint online using REST API?
    Friday, January 20, 2017 9:31 AM

All replies

  • As I remember, you can get current item version number. Using JS you can definitely get.

    Thanks, Ashish | Please mark a post helpful/answer if it is helpful or answer your query.

    Friday, January 20, 2017 12:27 PM
  • Hi,

    Here is the sample code for your reference.

    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
        <script type="text/javascript" src="https://o365e3w15.sharepoint.com/sites/lee/SiteAssets/jquery.SPServices-0.7.2.min.js"></script>   
        <script type="text/javascript">
            function getVersion() {
                $().SPServices({
                    operation: "GetVersionCollection",
                    async: false,
                    strlistID: "4A8847FD-8670-4F44-8D98-F48EBCDA17FA",
                    strlistItemID: 1,
                    strFieldName: "_UIVersionString",
                    completefunc: function (xData, Status) {
                        $(xData.responseText).find("Version").each(function (i) {
                            console.log("Name: " + $(this).attr("_UIVersionString") + " Modified: " + $(this).attr("Modified"));
                        });
                    }
                });
            }
        </script>
        <input type="button" onclick="getVersion()" value="getVersion" />

    Best Regards,

    Lee


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Wednesday, February 8, 2017 9:07 AM
  • Hi,

    Definitely the best way is using the REST API getchanges, in this way you have the ability to check the all changes in a list:

    https://msdn.microsoft.com/en-us/library/office/dn531433.aspx#bk_ListGetChanges

    Kind regards,


    Giuliano De Luca - MCSD SharePoint, MCSD Web Applications, MCPS, MS. www.delucagiuliano.com Twitter: @giuleon Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

    Wednesday, February 8, 2017 9:51 AM