Get All Attachments From SharePoint 2013 List Item using Rest API

Here we will discuss how we can retrieve all attachments from a SharePoint 2013 list item using Rest API in SharePoint 2013. Here I have a list and each item has some attachments. We will try to retrieve all the attachments from a particular item using Rest API.

You may read:
Add user to SharePoint group using JavaScript object model in SharePoint 2013

Get SharePoint 2013 List Item Count using Rest API and ECMAScript object model

Record Management in SharePoint 2013 or SharePoint 2013 Online

In this example, I am trying to retrieve attachments from item whose id is 3.

Put the below code in a script editor web part.

<script src=””></script>
var requestUri = _spPageContextInfo.webAbsoluteUrl + “/_api/web/lists/getbytitle(‘MyTestList’)/items(3)/AttachmentFiles”;
url: requestUri,
type: “GET”,
headers: {
“content-type”: “application/json;odata=verbose”,
success: onSuccess,
error: onError

function onSuccess(data) {
var itemsCount = data.d.results.length;
alert (itemsCount);
if (data) {
$.each(data.d.results, function () {
// do something
alert( this.ServerRelativeUrl);

function onError(error) {






<input type=”button” id=”btnClick” value=”Get Attachments”/>

Hope this will be helpful.

Check out Best Alternative to InfoPath -> Try Now

EnjoySharePoint YouTube Channel

About Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site

View all posts by Bijay Kumar →