sharepoint:sp-rest

SharePoint

REST (SharePoint)

SharePoint Representational State Transfer (REST) service.

mindmap Root (REST in SharePoint) REST API Overview Protocol Format Endpoints Lists Sites Users Authentication OAuth App-Only Common Operations GET POST PUT DELETE Use Cases Data Retrieval Integration Custom Applications

REST (Representational State Transfer) is an architectural style that allows you to interact with SharePoint data using standard HTTP requests. SharePoint provides a RESTful web service that enables developers to access and manipulate SharePoint resources such as lists, items, and libraries in a straightforward and flexible manner.

  • Standard HTTP Methods: Supports standard HTTP methods like GET, POST, PUT, and DELETE to perform CRUD operations.
  • JSON Format: Data is exchanged in JSON format, making it easy to work with in JavaScript and other programming languages.
  • OData Protocol: Supports OData (Open Data Protocol), allowing for rich querying capabilities, including filtering, sorting, and pagination.
  • Cross-Domain Requests: Can be accessed from client-side code in browser scenarios using CORS (Cross-Origin Resource Sharing).
  • Retrieving list items and document libraries.
  • Creating new list items or libraries.
  • Updating existing items.
  • Deleting items from lists or libraries.
  • Executing complex queries and fetching related data.

To retrieve items from a SharePoint list using the REST API, you would perform a GET request to the following endpoint:

GET /_api/web/lists/getbytitle('ListName')/items

This will return a JSON array of items in the specified list.

Accessing the REST API in SharePoint typically requires authentication. Depending on the environment (on-premises or SharePoint Online), you may use:

  • OAuth tokens (for SharePoint Online)
  • NTLM or Kerberos (for on-premises SharePoint)

Example REST APIs:

Tools:

  • sharepoint/sp-rest.txt
  • Last modified: 2024/11/08 13:28
  • by Henrik Yllemo