lundi 5 janvier 2015

get the attachement files from REST API



I use REST API SharePoint 2013 to get the items from list: And and I want to get the Attachments Files, How can i do that?


This the code :



function getListItems(url, listname, query, complete, failure) {

// Executing our items via an ajax request
$.ajax({
url: url + "/_api/web/lists/getbytitle('" + listname + "')/items" + query,
method: "GET",
headers: { "Accept": "application/json; odata=verbose" },
success: function (data) {
complete(data); // Returns JSON collection of the results

},
error: function (data) {
//failure(data);
alert("failure");
}
});

}


I use the console of my navigator : data.d.results[5].Attachments=true



data.d.results[0].AttachmentFiles.__deferred.uri= http://wbcjdyzd/_api/Web/Lists(guid'ba46572a-3bac-4813-8692-d890fbb88b29')/Items(14)/AttachmentFiles


But I don't get the URL of the file.








0 commentaires:

Enregistrer un commentaire