none
how to get items from more list by rest api

모든 응답

  • check this link: Working with lists and list items with REST. And you may perform requests to the REST endpoitns either from server side (e.g. by using HttpClient if you work with .Net) or from client side (e.g. via jquery.ajax).

    Blog - http://sadomovalex.blogspot.com
    Dynamic CAML queries via C# - https://github.com/sadomovalex/camlex

    2018년 7월 12일 목요일 오후 3:07
  • Hi,

    If want to get items from more list in Rest API, it needs to do multiple calls with corresponding list name like this:

    http://sp/sites/dev/_api/Web/Lists/GetByTitle('Dummy')/items

    Call with ajax in Jquery:

    <script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.js"></script>
    <script type="text/javascript">
       $.ajax({
            url: _spPageContextInfo.siteAbsoluteUrl + "/_api/web/lists/getbytitle('Dummy')/items",
            type: "GET",
            contentType: "application/json;odata=verbose",
            headers: {
                "Accept": "application/json;odata=verbose",
                "X-RequestDigest": $("#__REQUESTDIGEST").val()
                
            },
            success: function (data) {
                //alert('Success');
                console.log(data.d.results);
            },
            error: function (data) {
                alert("Error");
                
            }
        });
    
    </script>
    

    Json result for items:

    Thanks

    Best Regards


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


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    2018년 7월 13일 금요일 오전 7:38