Reputation: 43
Good Afternoon. I'm not sure what I'm doing wrong here. I have a REST API call on a SharePoint list and for the life of me cannot figure out why I'm getting a 400 Bad Request message. Here's my call....
myURL = "my sharepoint site URL"
$.ajax({
url: myURL + "/org/Analysis/_api/web/list/GetByTitle('Analysis')/items?$filter=Accepted%20eq%20%27Yes%27&$select=Date_x0020_of_x0020_Activity, Accepted"
method: "GET"
headers:{"ACCEPT" : "application/json;odata=verbose",
"content-type":"application/json;odata=verbose"
},
// success function and some other stuff
});
Thank you in advance....
Upvotes: 0
Views: 920
Reputation: 1
You can refer to the following url
_api/web/list/GetByTitle('Analysis')/items?$select=Date_x0020_of_x0020_Activity,Accepted&$filter=Accepted eq 'Yes'
Upvotes: 0
Reputation: 23
Can you try with changing the code?
headers: {
"Accept": "application/json;odata=verbose",
"Content-Type": "application/json;odata=verbose",
"X-RequestDigest": $("#__REQUESTDIGEST").val()
}
Upvotes: 0