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
31
votes
6answers
85k 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 ...
28
votes
3answers
44k 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 ...
25
votes
6answers
31k 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/...
25
votes
6answers
50k 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 ...
24
votes
3answers
25k 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 ...
23
votes
3answers
14k 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 ...
22
votes
4answers
40k 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?
21
votes
4answers
34k 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 ...
20
votes
3answers
59k 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? ...
20
votes
1answer
5k 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 ...
18
votes
2answers
22k 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 = { "...
17
votes
7answers
81k 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. ...
17
votes
0answers
215 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 ...
16
votes
3answers
22k 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 ...
16
votes
2answers
20k 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(...
16
votes
1answer
9k 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?
16
votes
2answers
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....
15
votes
3answers
4k 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 ...
15
votes
2answers
2k views

Which one is faster CSOM or JSOM

Understanding which one has better performance for performing CRUD operation in SharePoint List, CSOM or JSOM?
15
votes
3answers
2k 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/...
14
votes
1answer
52k 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: ...
14
votes
4answers
6k 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 ...
14
votes
2answers
4k 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?
14
votes
1answer
7k 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-...
13
votes
3answers
18k 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 ...
13
votes
3answers
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 ...
13
votes
3answers
18k 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 ...
13
votes
2answers
11k 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 ...
13
votes
5answers
5k 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. ...
13
votes
2answers
25k 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 = ...
13
votes
4answers
9k 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 ...
13
votes
2answers
4k 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 ...
12
votes
6answers
18k 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 ...
12
votes
2answers
16k 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 = (...
12
votes
4answers
18k 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='...
12
votes
1answer
9k 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): ...
12
votes
2answers
9k 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?
12
votes
2answers
8k 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 ...
12
votes
4answers
746 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 ...
12
votes
2answers
3k 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=...
11
votes
2answers
2k 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 ...
11
votes
1answer
12k 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: ...
11
votes
2answers
7k 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 ...
11
votes
2answers
12k 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(); ...
11
votes
3answers
6k views

Get list item “Likes” using JSOM or REST API's?

How can you retrieve a list items "Likes" using the JSOM or REST API's? I know there is the following method: SP.Social.SocialFeedManager.getAllLikers(postId), but in testing I was not successful ...
11
votes
1answer
931 views

REST: set ReadSecurity / WriteSecurity (Item Level Permissions)

Is it possible to set this with REST (or JSOM?) (these are not exposed as properties in List REST endpoint: MSDN List) I can set this: with PowerShell: $spList.ReadSecurity=2 # 1=read all items, 2=...
11
votes
1answer
783 views

How to create ContentType with FieldLinks using REST on O365

I'm trying to create a ContentType with FieldLinks using REST only (no SP.ClientContext) on SharePoint Online, but I'm not able to make it work. Creating ContentType by POSTing to _api/Web/...
10
votes
2answers
35k 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/...
10
votes
5answers
16k views

Query SP2013 Managed metadata term store

I was wondering if it is possible to query the Term Store via the REST API or Javascript Client Object Model in SP2013. I can't quite seem to work out the naming scheme for the REST API to discover ...
10
votes
3answers
4k 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 ...