Questions tagged [rest]

The REST (Representational State Transfer) interface in provides access to lists and libraries as a relational data service. A core concept of any RESTful interface is the resource, and in SharePoint Foundation, lists and items are represented as HTTP resources that can be addressed by remote URLs.

Filter by
Sorted by
Tagged with
36 votes
6 answers
166k views

REST API filter by start and end dates using 'today'

I'm new to filtering dates with REST in SP but am trying to do something like below but am not sure how to get today's date in as a variable into the request. I don't think I'm too far off so any help ...
Aaron's user avatar
  • 732
31 votes
3 answers
81k views

REST expand people column

I have a list with a people column called AssignedTo. I'm making a rest call: .../_api/web/Lists/GetByTitle('listname')/Items?$expand=AssignedTo&$select=*,AssignedTo/Title Which is successfully ...
Rothrock's user avatar
  • 3,010
27 votes
4 answers
44k views

REST API OData Filter on Boolean not Working

When I perform a REST query to the following URL: _api/web/lists/getbytitle('BtProjects')/items?$filter=Active eq true I receive only the one item that has this field marked as false. I get the same ...
Robert Kaucher's user avatar
26 votes
6 answers
45k views

Send E-mail from javascript using REST API

I want to send email using Javascript/jQuery using REST API in SharePoint. I have tried _api/SP.Utilities.Utility.SendEmail and this is my code: Code $.ajax({ contentType: 'application/...
Kaushal Khamar's user avatar
26 votes
5 answers
73k views

Expanding columns in lookup fields

Using the SharePoint 2013 REST API, Can I get more than one column from the lookup column by using the $select and $expand endpoints?
Aman Gupta's user avatar
25 votes
6 answers
59k views

How can I authenticate SharePoint REST calls from JavaScript?

I have been banging my head against a wall on this problem for weeks now Warning and Disclaimer .. I have very little JavaScript experience when it comes to REST / Web Services I have an on premises ...
Martin Hatch's user avatar
  • 1,303
24 votes
3 answers
89k views

Adding new list item using REST

I am currently using Office 365 and lots of REST queries to display data. However I am now creating my own forms using Bootstrap and jQuery. However, how do I use REST to add the data to the list? ...
Miyagi's user avatar
  • 623
23 votes
3 answers
18k views

SharePoint 2013 REST expand and filter issue

I've been using REST for a lot of tasks, and with the recently added $batch endpoint, it's more fun than ever. There is one thing bugging me though, and I'd like to share it with you, perhaps someone ...
Alex Pedersen's user avatar
22 votes
4 answers
45k views

REST POST: How to add a list item with 'people and group', 'choice,' and 'URL' fields?

I am trying to create a form for a SharePoint Hosted app that will allow users to request a teamsite. The form writes to a list that is contained in the SharePoint site collection, from which a timer ...
Mikel's user avatar
  • 231
20 votes
1 answer
115k views

Rest API - $filter multiple values

Assuming there is a list of Students each with a zip-code, how can I get records for multiple (but not all) zip-codes. When using $filter how do specify multiple values? Here's what I have so far: ...
pzirkind's user avatar
  • 345
20 votes
1 answer
9k views

REST list item delete does not go to Recycle Bin

I have a SharePoint 2013 autohosted app with a number of lists inside of it. I would like to be able to soft delete a list item using the REST API and have it go to the Recycle Bin instead of being ...
mossjm's user avatar
  • 303
19 votes
2 answers
28k views

SharePoint 2013 REST - Create list item with user field and lookup field

I'm trying to add an SPListItem to an SPList via REST, but have a problem with User or Group and Lookup (information already on this site). function adddullitem() { var item = { "...
Chetvergov's user avatar
18 votes
7 answers
112k views

REST with $filter for List Items in Sharepoint 2013

Sharepoint 2013, REST API, native C++ application: I want to get all Folder items from the list. Try /_api/Web/Lists(guid'GUID')/Items?$filter=FileSystemObjectType+eq+1 and get HTTP 400 Bed request. ...
andrii's user avatar
  • 369
17 votes
2 answers
71k views

Order by Rest API in SharePoint 2013

var restURLAuthors = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('GoGreenReport')/items?$select=EncodedAbsUrl,FileRef&$filter=Project_x0020_Name eq '"+$("#ddnProjectName").val()...
OM-ॐ's user avatar
  • 661
17 votes
0 answers
266 views

Replacing SOD with fetch (handling JS library dependencies - *in the future*)

Anticipating a future, I am experimenting with User Custom Actions in the new Document Library View Microsoft has so kindly provided to the First Release Office365 tenants. Since there is almost ...
Danny '365CSI' Engelman's user avatar
16 votes
3 answers
30k views

Getting document name using REST (not title) while filtering document library

I am trying to filter through a list and return metadata of the documents in that filter. How do I return the name of a document from a document library using REST while being able to filter the ...
Jordan's user avatar
  • 2,814
16 votes
4 answers
37k views

Updating Lookup Values with the REST API

Is it possible to update a List Item's Lookup Field Value via the Rest API? I can retrieve the field value if I use $select and $expand, but I can't find documentation anywhere that explains how to ...
Omar Stewey's user avatar
  • 1,170
16 votes
4 answers
10k views

Basic batched GET requests using REST API

I'm hunting around on the web right now for some basic (preferably working) examples of making a batch of GET requests using the new $batch endpoint in O365 with the REST API. I've located some good ...
John-M's user avatar
  • 5,930
16 votes
2 answers
34k views

Get the group of the current user using REST API

I'm trying to get the group of current user. By using this code: function checkGroup() { var group = ["D", "Sup", "A", "CP"]; for (var i = 0; i < group.length; i++) { if (isMember(...
Imen Turki's user avatar
  • 2,183
16 votes
5 answers
9k views

SharePoint REST API getbytitle with ampersand in title?

Trying to use the SP2013 REST API to ping a library with the title "Prep & Admin Docs" and I can't use getbyID as this snippet will be used in multiple sites where the GUID of the list will vary. ...
Chris G.'s user avatar
  • 161
16 votes
1 answer
11k views

Distinguish between approved and not approved items (REST api)

I don´t want to ask the same question here again. But to understand the origin of my question this could be helpful (https://stackoverflow.com/questions/26054246/sharepoint-2013-fetch-only-last-...
Worn's user avatar
  • 699
16 votes
1 answer
12k views

Is it possible to create a Document Set using REST API

I know this can be done using the JSOM, but is it possible via the REST API to create a document set?
Robert Kaucher's user avatar
16 votes
2 answers
32k views

How to get all properties of all users in SharePoint 2013 Rest API?

I am using this code to get all properties for just myself (current user). But how can I change this so that I can get the same data but for all the users in SharePoint? var oldurl = ...
omega's user avatar
  • 2,160
16 votes
2 answers
2k views

REST and CSOM much slower than List Web Service

lists.asmx = Web Service listdata.svc = REST API client.svc = CSOM Using JavaScript to query a list using the 3 available APIs, I'm finding lists.asmx responds much faster than listdata.svc or client....
Fergal's user avatar
  • 415
16 votes
3 answers
14k views

Getting data from SharePoint Online with an App, service to service

I have registered an App in my SharePoint Online, and I can use it's ID and secret with the Office Dev PnP PowerShell library. Works like a charm. Now the issue is that we are trying to connect to the ...
David Lozzi's user avatar
  • 7,372
15 votes
1 answer
18k views

How do I update a Hyperlink field using the REST API?

I have a SharePoint 2013 page that I want to make updates to a hyperlink field in a list. I'm calling the REST API using JavaScript + jQuery. My code (my hyperlink field is Timesheet_x0020_Page): ...
Kit Menke's user avatar
  • 4,193
15 votes
2 answers
3k views

Which one is faster CSOM or JSOM

Understanding which one has better performance for performing CRUD operation in SharePoint List, CSOM or JSOM?
Vikas Sharma's user avatar
15 votes
3 answers
3k views

How to access a custom field of a list using REST

I'm trying to get information from a list in a custom SPField called "My Field" with the internal name "MyField" using this JavaScript code: $.ajax({ url: "http://<URL>/_api/web/lists/...
Markus's user avatar
  • 357
14 votes
3 answers
26k views

How to get SPFieldChoice values using rest api SharePoint 2013?

I have a choice field in my list. I can get it values using server object model by following way List<string> fieldList; SPList spList = spWeb.Lists[listName]; SPFieldChoice field = (...
Atish Kumar Dipongkor's user avatar
14 votes
2 answers
72k views

Get all Files and Folders in one call

I want to get all the files and folders contained inside a SharePoint folder in one rest API call. We have the below API to get all the folders inside a folder <YouDomainServer>/_api/Web/...
jkr's user avatar
  • 403
14 votes
4 answers
8k views

How can I query for "AssignedTo = [ME]" using REST?

It is quite common to use "Assigned To = [Me]" in SharePoint views to list the tasks / items which are assigned to the current user. This of course includes both the items which are directly assigned ...
Martin Hatch's user avatar
  • 1,303
14 votes
2 answers
8k views

How to send a "like" or "unlike" command via REST API?

The structure of my REST-API Url is /_api/Web/Lists/GetByTitle('FAQ')/Items. Each item can be liked by users (like in discussion boards). How can I send a "Like" or "Unlike" command via REST?
MonsieurPoivron's user avatar
13 votes
6 answers
25k views

Paging using REST/OData with SP 2013

I'm trying to do paging on a document library (also trying this on a list) with SP 2013 using REST/OData but I can't seem to get the skipping of items working. Here are some examples of URLs that I'm ...
rbyrne's user avatar
  • 133
13 votes
3 answers
25k views

Check users group membership via REST API using AD-Groups in SP-Groups

I am aware that similar questions have been asked around here but none of them answers the part of AD-Groups that are used inside of SP-Groups. I have several SP-Groups in my teamsite. I follow best ...
Worn's user avatar
  • 699
13 votes
3 answers
6k views

SharePoint 2013 Call the REST API from SharePoint hosted app

I've successfully deployed a SharePoint Hosted App to Office 365 and my local on premise installation. All the app aims to do is call the REST API for the user profile manager to get the profile ...
Johnny Tordgeman's user avatar
13 votes
4 answers
11k views

Can't upload a non-text file to SharePoint App via REST API

I am using the following REST code to add a file as an attachment to a SharePoint 2013 list item. <asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server"> <SharePoint:ScriptLink ...
Fedor Shihantsov's user avatar
13 votes
2 answers
4k views

Filter by calculated column with rest api in Sharepoint 2013?

Apparently you can't filter by calculated column with SharePoint 2013 REST API? The calculated column in question returns a string. http://site/_api/web/lists/getbytitle('TestList')/items?$filter=...
CeeMoney's user avatar
  • 476
12 votes
4 answers
26k views

SharePoint REST API call with more than 500 rows

I have an AJAX call querying the SharePoint REST API which will return more than 500 rows: $.ajax( { url: _spPageContextInfo.webAbsoluteUrl + "/_api/search/query?querytext='...
tnw's user avatar
  • 517
12 votes
3 answers
12k views

Retrieve site collection quota and used storage from REST or JSOM

Is there a way to retrieve the amount of storage used and the quota limit for the Site Collection using the JSOM client or the REST web services?
Daniel Symonds-Lloyd's user avatar
12 votes
3 answers
16k views

Create multiple items via REST API

I'm looking to bulk create items to decrease the amount of calls being made in my application. In this instance, I'm working on a calendar control that has different needs than what SharePoint OOTB ...
EHorodyski's user avatar
  • 1,104
12 votes
2 answers
10k views

Retrieve toplevel site's subsites using REST _api

I'm currently working on an iOS app which uses _api-services to retrieve data stored in documents libraries of a SharePoint Online. Consuming _api/web/Lists/ works well so far. At the moment the REST ...
frank's user avatar
  • 123
12 votes
4 answers
3k views

Web/Lists/GetByTitle returns only 100 rows

I am facing a problem in Web/Lists/GetByTitle method. By default, it returns only 100 rows. I changed it to http://sitename/_api/Web/Lists/GetByTitle('list')/Items?$top=300. When I hit this URL ...
Ravi Mullick's user avatar
11 votes
3 answers
131k views

How to get all items in a view using REST API

by using rest api I get items like this http://mydomain/_api/web/lists/GetByTitle('MyList')/Items I get the view like this and naturally in it I have the GUID http://mydomain/_api/web/lists/...
Ergec's user avatar
  • 485
11 votes
3 answers
14k views

getFileByServerRelativeURL fails when the filename contains a quote

I'm using the SharePoint online REST API. Things generally work fine, but I'm failing to figure out how to get information about a file (document) that contains a quote in its name. Here's my REST ...
Roy2012's user avatar
  • 223
11 votes
2 answers
3k views

What is the permission level for REST Query?

If I execute the REST Query using JavaScript and I am logged in to the SharePoint with Visitor privileges then will my code be able to query the administrative data like getting the column name and so ...
users1100's user avatar
  • 3,230
11 votes
1 answer
27k views

Manage File permissions using REST API

Is there a way to manage File permissions (roles) using the REST API? http://msdn.microsoft.com/en-us/library/office/jj860569(v=office.15).aspx I'm developing an app asking for permission on the fly: ...
palig's user avatar
  • 253
11 votes
2 answers
15k views

sharepoint 2013 rest api upload image

I want to upload image or create image in Sharepoint 2013 document library using rest api (Javascript) my code to get bite array from input type file element is var reader = new FileReader(); ...
Vishal_Sharepoint's user avatar
11 votes
4 answers
5k views

How to avoid _metadata in a REST response (listData.svc)

I am pulling data from a SharePoint list with listData.svc, and _metadata represent more than half of the response content. Is there a way to return list fields only, without the metadata? Below an ...
Christophe's user avatar
  • 5,301
11 votes
3 answers
2k views

Creating Lookup column using rest which can take multiple values

To create a lookup column.. $.ajax({ url: "https://test/_api/Lists/getbytitle('abc')/fields/addfield", type: "POST", data: "{ 'parameters': { '__metadata': { 'type': 'SP....
KumarV's user avatar
  • 2,680
11 votes
1 answer
4k views

REST API Query Syntax

I'm trying to pull back all Projects that are Active and have a ProjectName="X". ProjectName is a lookup and Active is Yes/No. Here's what I have built: http://<siteurl>/_api/lists/getbytitle('...
Michael Colbs's user avatar

1
2 3 4 5
47