Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Using CAML Query in SharePoint Hosted app

$
0
0

Hi,

I am trying to execute a CAML Query in a SharePoint Hosted App, below is the JS code.

    executor.executeAsync({
        url: appwebUrl + "/_api/SP.AppContextSite(@target)/web/lists/getbytitle('Documents')/Items?/getitems?@target='" + hostweburl + "'",
        method: "POST",
    body: { 'query' : {'__metadata': { 'type': 'SP.CamlQuery' }, "ViewXml": "<View><Query><Where><Eq><FieldRef Name='Title'/><Value Type='TEXT'>value</Value></Eq></Where></Query></View>" } },
    headers: {
        "accept": "application/json; odata=verbose",
        "content-type": "application/json; odata=verbose"
    },
    success: successHandler,
    error: errorHandler
});

getting an error: Uncaught Error: "Invalid field or parameter requestInfo.body"


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>