background preloader

SharePoint REST API

Facebook Twitter

Use OData query operations in SharePoint REST requests. This documentation is archived and is not being maintained.

Use OData query operations in SharePoint REST requests

Learn how to use a wide range of OData query string operators to select, filter, and order the data you request from the SharePoint REST service. Use the $select query option to specify which fields to return for a given list, list item, or other SharePoint object represented by an entity set. You can use $select=* to return all available fields. In addition, you can specify that the request returns projected fields from other lists and the values of lookups. To do this, specify the field name in both the $select and $expand query options. Bulk expansion and selection of related items is not supported. Single value lookup fields are represented by two separate fields in the SharePoint REST service: one field representing the actual field value, and another representing the field name.

In the SharePoint REST service, users are represented by the user's friendly (display) name, and not their alias or domain\alias combination. Get to know the SharePoint 2013 REST service. SharePoint 2013 adds the ability for you to remotely interact with SharePoint sites by using REST.

Get to know the SharePoint 2013 REST service

Now, you can interact directly with SharePoint objects by using any technology that supports standard REST capabilities. To access SharePoint resources using REST, construct a RESTful HTTP request, using the Open Data Protocol (OData) standard, which corresponds to the desired client object model API. For example: Client object model method: List.GetByTitle(listname) REST endpoint: The client.svc web service in SharePoint handles the HTTP request, and serves the appropriate response in either Atom or JSON (JavaScript Object Notation) format. Fields REST API reference. This documentation is archived and is not being maintained.

Fields REST API reference

Learn about field-related resources and endpoints in the SharePoint REST API. The examples in this article use jQuery AJAX requests. Before you try to use the examples, do the following: See How REST requests differ by environment for more information about changing the requests. See Additional resources for links to more information about using the cross-domain library, OAuth, and the SharePoint REST service. Endpoint URI | Properties | Methods | OData representation. SharePoint and Web Services. In my last article, I showed you how to work with Windows SharePoint Services from within Microsoft Office 2003.

SharePoint and Web Services

But what if you're using something other than Office 2003 as as development environment, and want to tap into SharePoint data? No problem! Development With A Dot - Looping Through List Items in SharePoint 2013 Designer Workflows. SharePoint 2013 Designer workflows now has two new interesting options: the ability to call HTTP web services and the option to loop over some code a number of times.

Development With A Dot - Looping Through List Items in SharePoint 2013 Designer Workflows

This, together with the new REST API, which supports querying lists and returning data in JSON, allows iterating through list items in a workflow, something that was not possible before. In order to demonstrate this, let’s create a new Site Workflow in SharePoint Designer, that will iterate through the Tasks list: Call it Process Tasks, for example, and make sure you select SharePoint 2013 as the platform type. In the workflow designer, let’s start by creating a new stage, call it Retrieve Tasks: In it, we add a new Set Workflow Variable action which creates a new String variable called url with the value “ This uses the new REST API, and you can pass in additional options, such as for ordering by the DueDate field in descending order: desc or filtering: gt DateTime’2014-07-31T00:00:00’ or paging: That’s it. Consuming the SharePoint 2013 REST Service from SharePoint Designer.

In SharePoint 2013 workflows was introduced a new action named Call HTTP Web Service.

Consuming the SharePoint 2013 REST Service from SharePoint Designer

This action is flexible enough to make requests to a variety web services including SharePoint REST service. Figure 1 shows you the Call HTTP Web Service action on the SharePoint Designer 2013 surface. Figure 1. Calling user profile service from SharePoint Designer 2013 workflow yields "unauthorized" Current community your communities Sign up or log in to customize your list. more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help.

Calling user profile service from SharePoint Designer 2013 workflow yields "unauthorized"

Workflow Loop Through Multiple SharePoint Items. Finally!

Workflow Loop Through Multiple SharePoint Items

It can be done with a SharePoint Designer 2013 workflow! This is something that I’ve been wanting to be able to do for YEARS, and now it’s possible… and I’m just now blogging about it. No, this can’t be done in any previous versions unless you go buy a 3rd party tool or get a dev to write something custom. Think about any time you’ve wanted to be able to edit multiple items in a list according to some condition. Think about lookups. The example I’m going to use here is a very common one that you all ask me about.

So, here’s what we have. A list of tasks (just using the task list template)A list of people. The idea is that the workflow will be created on the Loop Through Tasks list, and for each list item where the tasks is not completed, and the due date has passed, it will send an email to the person that lists all of those tasks. Create your workflow on your list of people. 2013 - 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.

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

The form writes to a list that is contained in the SharePoint site collection, from which a timer job will read and complete the teamsite provisioning process. The list I am updating contains vital 'User and Group', 'Choice', and 'URL' fields and I am having difficulty getting my REST post to work. When I run this code, I get a 400 error with this JSON reponse: I have not been able to find any examples online of non-text fields being updated via REST services, so if anyone could provide samples or point me to good sources of information I would greatly appreciate it! Update: I have found the answer to most of my question. For the Choice field, just pass in the value and that works. For the "person or group" field, it's not so clear.

<d:PrimaryOwnerId m:type="Edm.Int32">2</d:PrimaryOwnerId> Dinusha's Blog: Cross site collection data access via HTTP web service for a SharePoint 2013 designer workflow. Resolving Unauthorized exception. Create a SharePoint Site (SPWeb) using REST in SPD 2013 Workflow – SharePointRyan. I have been struggling with an issue for several days, and it’s one I’ve been trying to solve for an upcoming SharePoint Saturday presentation.

Create a SharePoint Site (SPWeb) using REST in SPD 2013 Workflow – SharePointRyan

That issue is creating SharePoint sub sites/SPWebs automatically via the “Call HTTP Web Service” action in SharePoint Designer 2013 workflow. There were several sources of information that ultimately provided the solution, so I will be sure to credit those folks in this article. There are several steps which are required to make this happen, and the coolest part is; this will work both on-premise and in Office 365/SharePoint Online! The solution I was trying to provide was: Provide users a list for requesting project sitesProvide an automated workflow to request approval for the requested siteIf approved, create the site automatically with the requested settingsProvide the requesting user with an email notifying them of the approval The List The Workflow Obviously this is where all of the magic will happen.