You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/apis/alm-api-for-spfx-add-ins.md
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ ALM APIs can be used to perform exactly the same operations that are available f
28
28
ALM APIs are supported for the tenant-scoped site collections and [site collection app catalog](../general-development/site-collection-app-catalog.md). Use the corresponding app catalog's URL to target a specific app catalog. You must first enabled a site collection app catalog before targeting it with the actions documented on this page.
29
29
30
30
> [!IMPORTANT]
31
-
> Tenant-scoped permissions which require [tenant administrative approval](https://docs.microsoft.com/sharepoint/dev/solution-guidance/how-to-provide-add-in-app-only-tenant-administrative-permissions-in-sharepoint-online) are not supported with the ALM APIs.
31
+
> Tenant-scoped permissions which require [tenant administrative permissions](../solution-guidance/how-to-provide-add-in-app-only-tenant-administrative-permissions-in-sharepoint-online.md) are not supported with the ALM APIs.
32
32
33
33
## Options for working with ALM APIs
34
34
@@ -42,12 +42,12 @@ The app catalog must be included in all HTTP requests when using the REST API as
# Build mobile apps for other platforms using SharePoint
11
12
Learn how to use Representational State Transfer (REST) to create a SharePoint mobile app for any platform.
13
+
12
14
Mobile devices have become more powerful and easy to use nowadays. Laptops, netbooks, tablet PCs, and mobile phones provide workers access to the information and applications that they need to do their jobs. And developing applications for mobile devices is now easier than ever. As a result, more and more business scenarios demand integrating client applications together with their business processes. This article describes how to integrate mobile client apps together with SharePoint. You can create a mobile app to browse SharePoint content from any ___location and connect with SharePoint lists and libraries to access data.
13
-
14
-
15
-
15
+
16
+
17
+
16
18
17
19
To develop a mobile app that interacts with SharePoint, you can use common services that can be accessed using open protocols. SharePoint Foundation 2010 introduced the client object models, which enabled developers to perform remote communication with SharePoint by using the web programming technology of their choice: .NET Framework, Microsoft Silverlight, or JavaScript. SharePoint introduces a Representational State Transfer (REST) service that is fully comparable to the client object models. In SharePoint, nearly every API in the client object models will have a corresponding REST endpoint. Now, developers can interact remotely with the SharePoint object model by using any technology that supports REST web requests. REST can be consumed by any programming language that you want to use for your mobile application development.
18
20
You can perform basic create, read, update, and delete (CRUD) operations by using the REST interface provided by SharePoint. REST exposes all of the SharePoint entities and operations that are available in the other SharePoint client APIs. One advantage of using REST is that you don't have to add references to any SharePoint libraries or client assemblies. Instead, you make HTTP requests to the appropriate endpoints to retrieve or update SharePoint entities, such as webs, lists, and list items. For a thorough introduction to the SharePoint REST interface and its architecture, see [Use OData query operations in SharePoint REST requests](https://msdn.microsoft.com/library/d4b5c277-ed50-420c-8a9b-860342284b72%28Office.15%29.aspx).
To use the REST capabilities that are built into SharePoint, you can construct a RESTful HTTP request using the Open Data Protocol (OData) standard that corresponds to the desired client object model API. The client.svc web service handles the HTTP request and serves the appropriate response, in either Atom or JavaScript Object Notation (JSON) format. The client application must then parse that response. Figure 1 shows a high-level view of the SharePoint REST architecture.
The endpoints in the SharePoint REST service correspond to the types and members in the SharePoint client object models. By using HTTP requests, you can use these REST endpoints to perform typical CRUD operations against SharePoint artifacts, such as lists and sites.
46
-
47
-
48
-
48
+
49
+
50
+
49
51
In general:
50
-
51
-
52
-
52
+
53
+
54
+
53
55
54
56
- Endpoints that represent read operations map to HTTP **GET** commands.
55
-
56
-
57
+
58
+
57
59
- Endpoints that represent update operations map to HTTP **POST** commands.
58
-
59
-
60
+
61
+
60
62
- Endpoints that represent update or insert operations map to HTTP **PUT** commands.
61
-
62
-
63
+
64
+
63
65
In choosing an HTTP request to use, you should also consider the following:
64
-
65
-
66
-
66
+
67
+
68
+
67
69
68
70
- Use **POST** to create artifacts such as lists and sites. The SharePoint REST service supports sending **POST** commands that include object definitions to endpoints that represent collections.
69
-
70
-
71
+
72
+
71
73
- For **POST** operations, any properties that are not required are set to their default values. If you try to set a read-only property as part of a **POST** operation, the service returns an exception.
72
-
73
-
74
+
75
+
74
76
- Use **PUT**, **PATCH**, and **MERGE** operations to update existing SharePoint objects. Any service endpoint that represents an object property **set** operation supports both **PUT** requests and **MERGE** requests. For **MERGE** requests, setting properties is optional; any properties that you do not explicitly set retain their current property. But for **PUT** commands, any properties you do not explicitly set are set to their default properties. In addition, if you do not specify all settable properties in object updates when you use HTTP **PUT** commands, the REST service returns an exception.
75
-
76
-
77
+
78
+
77
79
- Use the HTTP **DELETE** command against the specific endpoint URL to delete the SharePoint object represented by that endpoint. For recyclable objects, such as lists, files, and list items, this results in a **Recycle** operation. For more information, see [Get to know the SharePoint REST service](https://msdn.microsoft.com/library/2de035a0-ac75-43bd-9665-5c5a59c4c590%28Office.15%29.aspx).
To authenticate your mobile app with SharePoint, you can use the MS-OFBA protocol. For more information, see [[MS-OFBA]: Office Forms Based Authentication Protocol Specification](https://msdn.microsoft.com/library/30c7bbe9-b284-421f-b866-4e7ed4866027%28Office.15%29.aspx). The protocol client is configured to store and transmit cookies. The protocol client relies on the remote protocol server to set the user's identity as one or more HTTP cookies. After the user's identity is established, the client then sends each cookie with each subsequent HHT request.
85
-
86
-
87
-
87
+
88
+
89
+
88
90
When a user signs in to SharePoint, the user's token is validated and then used to sign in to SharePoint. The user's token is a security token that is issued by an identity provider. SharePoint supports several kinds of authentication. For more information, see [Authentication, authorization, and security in SharePoint](authentication-authorization-and-security-in-sharepoint.md). To authenticate a user, you can use the REST interface. The authorization process verifies that an authenticated subject (an app or a user the app is acting on behalf of.md) has permission to perform certain operations or to access specific resources (for example, a list or a SharePoint document folder.md).
89
-
90
-
91
-
91
+
92
+
93
+
92
94
OData lets you access a data source, such as a database, by browsing to a specially constructed URL. This allows for a simplified approach for connecting to, and working with, data sources that are hosted within an organization. OData is a protocol that uses HTTP, Atom, and JavaScript Object Notation (JSON) to enable developers to write applications that communicate with an ever-growing number of data sources. Microsoft supports the creation of this standard as a way to enable the exchange of data between applications and data stores that can be accessed from the web. The new OData connector enables SharePoint to communicate with OData providers. For more information, see [Open Data Protocol](http://www.odata.org).
93
-
94
-
95
-
95
+
96
+
97
+
96
98
The following code demonstrates how to authenticate your app to SharePoint using REST endpoints for basic or forms-based authentication. The following code example is written in C#, but any other programming language can be used to create the Http request, as per the requirement of the platform.
To authenticate an **HttpWebrequest** to the endpoint, you should first authenticate to SharePoint with the **ODataAuthenticator** class. Before calling the **Authenticate** method, register the **ODataAuthenticator** object to the **AuthenticationCompleted** event.
139
-
140
-
141
-
141
+
142
+
143
+
142
144
After authentication is done inside the **OnAuthenticationCompleted** event, you can use the **CookieContainer** property on the **ODataAuthenticator** object, which can be attached to the **HttpWebRequest** object to authenticate the REST calls to SharePoint.
accept: "application/json;odata=verbose" or "application/atom+xml"
184
186
185
187
```
186
188
187
189
The following XML shows an example of the list item properties that are returned when you request the XML content type.
188
-
189
-
190
-
190
+
191
+
192
+
191
193
192
194
193
195
@@ -212,13 +214,13 @@ The following XML shows an example of the list item properties that are returned
212
214
```
213
215
214
216
The following example shows how to **create** a list item.
215
-
217
+
216
218
> [!NOTE]
217
-
>
219
+
>
218
220
> To do this operation, you must know the **ListItemEntityTypeFullName** property of the list and pass that as the value of **type** in the HTTP request body.
The following example shows how to **update** a list item.
242
-
244
+
243
245
> [!NOTE]
244
246
> To do this operation, you must know the **ListItemEntityTypeFullName** property of the list and pass that as the value of **type** in the HTTP request body.
245
-
246
-
247
-
247
+
248
+
249
+
248
250
249
251
250
252
@@ -266,9 +268,9 @@ headers:
266
268
```
267
269
268
270
The following example shows how to **delete** a list item.
269
-
270
-
271
-
271
+
272
+
273
+
272
274
273
275
274
276
@@ -286,42 +288,42 @@ headers:
286
288
```
287
289
288
290
For more information, see [Complete basic operations using SharePoint REST endpoints](https://msdn.microsoft.com/library/e3000415-50a0-426e-b304-b7de18f2f7d9%28Office.15%29.aspx).
289
-
290
-
291
-
291
+
292
+
293
+
292
294
293
295
## See also
294
296
<aname="bk_addresources"> </a>
295
297
296
298
297
299
-[Build Windows Phone apps that access SharePoint](build-windows-phone-apps-that-access-sharepoint.md)
298
-
299
-
300
+
301
+
300
302
-[Using the SharePoint REST service](https://docs.microsoft.com/sharepoint/dev/sp-add-ins/get-to-know-the-sharepoint-rest-service)
301
-
302
-
303
+
304
+
303
305
-[Build Windows Phone apps that access SharePoint](build-windows-phone-apps-that-access-sharepoint.md)
304
-
305
-
306
+
307
+
306
308
-[Choose the right API set in SharePoint](choose-the-right-api-set-in-sharepoint.md)
307
-
308
-
309
+
310
+
309
311
-[Use OData query operations in SharePoint REST requests](https://msdn.microsoft.com/library/d4b5c277-ed50-420c-8a9b-860342284b72%28Office.15%29.aspx)
310
-
311
-
312
+
313
+
312
314
-[Get to know the SharePoint REST service](https://msdn.microsoft.com/library/2de035a0-ac75-43bd-9665-5c5a59c4c590%28Office.15%29.aspx)
313
-
314
-
315
+
316
+
315
317
-[Open Data Protocol](http://www.odata.org/)
316
-
317
-
318
+
319
+
318
320
-[Authorization and authentication of SharePoint Add-ins](https://msdn.microsoft.com/library/bde5647a-fff1-4b51-b67b-2139de79ce4a%28Office.15%29.aspx)
0 commit comments