- You can perform CRUD operations like Create, Read, Update and Delete.
- REST means Representational State Transfer
- SP introduces client side object model and then similar or corresponding other solution is REST API.
- Users can intact with application remotely with SharePoint data that support REST web requests.
- It supports OData syntax which means standard open data protocal
- Firstly we need to create Restfull HTTP request by using OData standard which is corrosponding to the CSOM API.
- After interacting with SharePoint database with HTTP request, it retries or gives the data back in JSON format which is also called as Javascript Object Notation.
GET, POST, PUT or MERGE, DELETE are the HTTP requests used in REST API
_spPageContextInfo.webAbsoluteUrl + "/_api/Web/Lists/GetByTitle('ListName')/Items
While create a list item,
var data = {
__metadata: { 'type': 'SP.Data.SpTutorialListItem' },
Title: 'Some title',
SpMultiline: 'Put here some multiline text.
You can add here some rich text also',
SpChoice: 'Choice 3',
SpNumber: 5,
SpCurrency: 34,
SpDateTime: new Date().toISOString(),
SpCheckBox: true,
SpUrl: {
__metadata: { "type": "SP.FieldUrlValue" },
Url: "http://test.com",
Description: "Url Description"
},
SpPersonId: 3,
SpLookupId: 2
};
Comments
Post a Comment