Work with data in SharePoint 2013

apps for SharePoint

Find resources and guidance for accessing and manipulating data in apps in SharePoint 2013.

In your apps, you will frequently have to retrieve and manipulate SharePoint data, such as items in document libraries and lists, metadata, or user profiles. Similarly, in some scenarios you might have to access data that is exposed by your app from within a SharePoint page or component. The model for apps for SharePoint in SharePoint 2013 provides multiple connectivity options and a rich set of APIs for accessing the rich data and services that reside in SharePoint and in the remote app.

Table 1. Resources and guidance for working with data in apps for SharePoint



How to: Access SharePoint 2013 data from apps using the cross-domain library

The cross-domain library is a client-side alternative in the form of a JavaScript file (SP.RequestExecutor.js) that is hosted in the SharePoint website that you can reference in your remote app. This library lets you interact with more than one domain in your remote app page through a proxy. It is a good option if you prefer your app code to run in the client rather than in the server, or if there are connectivity barriers, such as firewalls, between SharePoint and your remote infrastructure. You can access data in the host web: for example, you can access lists that end users interact with regardless of your app. Or you can access data in the app web, which only exists when your app is deployed. You can also access other site collections and websites as long as the app has permissions.

How to: Create a custom proxy page for the cross-domain library in SharePoint 2013

You can use the cross-domain library to access data in your remote app if you provide a custom proxy page that is hosted in the remote app infrastructure. As the developer, you are responsible for implementing the custom proxy page, and you have to deal with custom logic, such as the authentication mechanism to the remote app. Use the cross-domain library with a custom proxy page if you want the communication to occur at the client level.

How to: Query a remote service using the web proxy in SharePoint 2013

You can use the web proxy that is exposed in the JavaScript/.NET client object models. When you use the web proxy, you issue the initial request to SharePoint. In turn, SharePoint requests the data to the specified endpoint and forwards the response back to your page. Use the web proxy when you want the communication to occur at the server level.

OAuth plays an important role in the model for apps for SharePoint. OAuth is an open protocol for authorization that enables secure authorization in a simple and standard way from desktop and web applications. OAuth enables users to approve an application to act on their behalf without sharing their user name and password. For example, it enables users to share their private resources or data (contact list, documents, photos, videos and so on) that are stored on one site with another site, without having to provide their credentials (typically a user name and password). For more information, see Authorization and authentication for apps in SharePoint 2013.

Table 2. Resources and guidance for working with OAuth in apps for SharePoint



How to: Get user identity and properties in SharePoint 2013

Learn how to use OAuth access tokens in SharePoint to access website information, such as the title and user properties.

Finished with the data requirements for your app? Create a great user experience (UX) for your app by using the options available in the model for apps for SharePoint. For more information, see Create UX components in SharePoint 2013.

Community Additions

© 2014 Microsoft