Working with lists and list items with REST (2023)

  • Article
  • 19 minutes to read

Cima

The SharePoint Online REST service (and SharePoint 2016 on-premises and later) supports combining multiple requests into a single service call using OData.$lotquery option. For details and links to code samples, seeMake batch requests using REST APIs.

requirements

This topic assumes that you are already familiar with the topicsGet to know the SharePoint REST ServiceyPerform basic operations with SharePoint REST endpoints. It does not provide code snippets.

Retrieving lists and list properties using REST

The following example shows how to do it.Get a specific list if you know its GUID.

GET https://{site_url}/_api/web/lists(guid'{list_guid}')Authorization: "Portador" + accessTokenAccept: "aplicación/json;odata=verbose"

Use

If you want the response in JSON, useapplication/json;odata=detailedin themAcceptHeader.

If you want the response in Atom format, useapplication/atom+xmlin themAcceptHeader.

(Video) Read list items using Rest API in SharePoint

The following example shows how to do it.Get a specific list if you know its title.

OBTENER https://{site_url}/_api/web/lists/GetByTitle('List Title')Autorización: "Bearer" + accessTokenAccept: "application/json;odata=verbose"

The following XML shows an example of thelist properties returned when you request the XML content type.

<tipo de contenido="aplicación/xml"> <m:propiedades> <d:AllowContentTypes m:type="Edm.Boolean">true</d:AllowContentTypes> <d:BaseTemplate m:type="Edm.Int32"> 100</d:BaseTemplate> <d:BaseType m:type="Edm.Int32">0</d:BaseType> <d:ContentTypesEnabled m:type="Edm.Boolean">false</d:ContentTypesEnabled> < d:Creado m:type="Edm.DateTime">2012-06-26T23:15:58Z</d:Created> <d:DefaultContentApprovalWorkflowId m:type="Edm.Guid">00000000-0000-0000-0000- 000000000000</d:DefaultContentApprovalWorkflowId> <d:Description>Eine von Project Based Retention erstellte Liste zum Speichern von Projektrichtlinienelementen.</d:Description> <d:Direction>none</d:Direction> <d:DocumentTemplateUrl m: null= "true" /> <d:DraftVersionVisibility m:type="Edm.Int32">0</d:DraftVersionVisibility> <d:EnableAttachments m:type="Edm.Boolean">true</d:EnableAttachments> < d: EnableFolderCreation m:type="Edm.Boolean">false</d:EnableFolderCreation> <d:EnableMinorVersions m:type="Edm.Boolean">false</d:EnableMinorVersions> <d:EnableModerat ion m:type=" Edm.Boolean ">false</d:EnableModeration> <d:EnableVersioning m:type="Edm.Boolean">false</d:EnableVersioning> <d:EntityTypeName>ProjectPolicyItemList</d:EntityTypeName > <d:ForceCheckout m:type= "Edm.Boolean">false</d:ForceCheckout> <d:HasExternalDataSource m:type="Edm.Boolean">false</d:HasExternalDataSource> <d:Hidden m:type ="Edm.Boolean">verdadero< /d:Oculto> <d:Id m:type="Edm.Guid">74de3ff3-029c-42f9-bd2a-1e9463def69d</d:Id> <d:ImageUrl>/_layouts /15/images/itgen.gif< /d:ImageUrl> <d:IrmEnabled m:type="Edm.Boolean">falso</d:IrmEnabled> <d:IrmExpire m:type="Edm.Boolean">falso </d:IrmExpire> <d: IrmReject m:type="Edm.Boolean">falso</d:IrmReject> <d:IsApplicationList m:type="Edm.Boolean">falso</d:IsApplicationList> <d :IsCatalog m:type="Edm. Booleano">falso</d:IsCatalog> <d:IsPrivate m:type="Edm.Boolean">falso</d:IsPrivate> <d:ItemCount m:type="Edm.Int32">0</d: ItemCount> <d:LastItemDeletedDate m:type="Edm.DateTime">2012-06-26T23:15:58Z</d:LastItemDeletedDate> <d:LastItemModifiedDate m:type="Edm.DateTime">2012-06-26T23 :15:59Z</d:LastItemModifiedDate> <d:ListItemEntityTypeFullName>SP.Data.ProjectPolicyItemListItem</d:ListItemEntityTypeFullName> <d:MultipleDataList m:type="Edm.Boolean">false</d:MultipleDataList> <d : NoCrawl m:type="Edm.Boolean">true</d:NoCrawl> <d:ParentWebUrl>/</d:ParentWebUrl> <d:ServerTemplateCanCreateFolders m:type="Edm.Boolean">true</d: ServerTemplateCanCreateFolders > <d:TemplateFeatureId m:type="Edm.Guid">00bfea71-de22-43b2-a848-c05709900100</d:TemplateFeatureId> <d:Title>Liste der Projektrichtlinienelemente</d:Title> </m: Eigenschaften> </Inhalar>

Use

DieListItemEntityTypeFullNameProperty (SP.Data.ProjectPolicyItemListItemin the example above) is especially important when you want to create and update list items. This value should be passed asuntilproperty in the metadata that is passed in the body of the HTTP request when creating and updating list items.

(Video) Get list items using Rest API in SharePoint Online and Display in HTML Table

Working with lists using REST

The following example shows how to do it.Make a list.

POST https://{site_url}/_api/web/listsAuthorization: "Bearer" + accessTokenAccept: "application/json;odata=verbose"Content-Type: "application/json"Content-Length: {request body length as integer }X-RequestDigest: "{form_digest_value}"{ "__metadata": { "type": "SP.List" }, "AllowContentTypes": true, "BaseTemplate": 100, "ContentTypesEnabled": true, "Description" : " Beschreibung meiner Liste", "Title": "Test"}

The following example shows how to do it.Update a list using the MERGE method.

POST https://{site_url}/_api/web/lists(guid'{list_guid}')Authorization: "Bearer" + accessTokenAccept: "application/json;odata=verbose"Content-Type: "application/json"Content- Length: {length of request body as integer}If-Match: "{etag or *}" X-HTTP-Method: "MERGE"X-RequestDigest: "{form_digest_value}"{ "__metadata": { "type" : " SP.List" }, "Title": "New Title"}

The following example shows how to do it.Create a custom field for a list.

POST https://{site_url}/_api/web/lists(guid'{list_guid}')/FieldsAuthorization: "Bearer" + accessTokenAccept: "application/json;odata=verbose"Content-Type: "application/json"Content -Length: {Länge des Anfragetexts als ganze Zahl}X-RequestDigest: "{form_digest_value}"{ "__metadata": { "type": "SP.Field" }, "Title": "field title", "FieldTypeKind": FieldType-Wert, „Erforderlich“: „verdadero/falso“, „EnforceUniqueValues“: „verdadero/falso“, „StaticName“: „Feldname“}

The following example shows how to do it.delete a list.

POST https://{site_url}/_api/web/lists(guid'{list_guid}')Autorización: "Bearer" + accessTokenAccept: "application/json;odata=verbose"If-Match: "{etag o *}" Método X-HTTP: "ELIMINAR" X-RequestDigest: "{form_digest_value}"

Lookup column changes

When referencing a lookup column in a list using the REST API, use the display name of the lookup column instead of its internal name.

OBTENER https://{site_url}/_api/web/lists/getbytitle('ListName')/Items?&$filter=LookupColumnId eq 1Autorización: "Bearer" + accessTokenAccept: "application/json;odata=verbose"

Working with list items using REST

Get all the elements of the list

The following example shows how to get all the elements of a list.

Use

(Video) Create a list item using REST API in SharePoint Online

  • He ONCEskip $The query parameter does not work when querying for list items. You can use the in many situations$saltatokenoption instead.
  • By default, the first 100 items are returned. See the documentation for more information on controlling the number of items, pagination, etc.OData Query Operations
OBTENGA https://{site_url}/_api/web/lists/GetByTitle('Test')/itemsAuthorization: "Bearer" + accessTokenAccept: "application/json;odata=verbose"

Get a specific list item

The following example shows how to get a specific list item.

OBTENGA https://{site_url}/_api/web/lists/GetByTitle('Test')/items({item_id})Autorización: "Bearer" + accessTokenAccept: "application/json;odata=verbose"

The following XML shows an example of the list item properties returned when you request the XML content type.

<tipo de contenido="aplicación/xml"> <m:propiedades> <d:FileSystemObjectType m:type="Edm.Int32">0</d:FileSystemObjectType> <d:Id m:type="Edm.Int32"> 1</d:Id> <d:ID m:type="Edm.Int32">1</d:ID> <d:ContentTypeId>0x010049564F321A0F0543BA8C6303316C8C0F</d:ContentTypeId> <d:Title>ein Element</d :Title> <d:Modificado m:type="Edm.DateTime">2012-07-24T22:47:26Z</d:Modified> <d:Creado m:type="Edm.DateTime">2012-07- 24T22:47:26Z</d:Creado> <d:AuthorId m:type="Edm.Int32">11</d:AuthorId> <d:EditorId m:type="Edm.Int32">11</d :EditorId> <d:OData__UIVersionString>1.0</d:OData__UIVersionString> <d:Archivos adjuntos m:type="Edm.Boolean">false</d:Archivos adjuntos> <d:GUID m:type="Edm.Guid"> eb6850c5-9a30-4636-b282-234eda8b1057</d:GUID> </m:propiedades></contenido>

Get articles as a stream

Gets information about the list and its data. You can use this API to get list items if they use complex fields like search or managed metadata.

POST https://{site_url}/_api/web/GetList(@listUrl)/RenderListDataAsStream?@listUrl=%27%2Fsites%2Fteam-a%2Flists%2FList%27Autorización: "Portador" + accessTokenAccept: "aplicación/json; odata=nometadata"Content-Type: "application/json;odata=nometadata"{ "parámetros": { "AddRequiredFields": "true", "DatesInUtc": "true", "RenderOptions": 17 }}

RenderListDataAsStream - URI - Parameter

The following properties can be added as query string parameters to manipulate the returned data.

Propertydescriptionuntilexample
CascDelWarnMessageSpecifies whether to display a message when there is a cascading delete warningnumber1
RipIndicates that some groups will be expanded in a grouped view. used withgroup string.line
group stringGroup identifier used for drill down functionality.line
HasOverrideSelectCommandIt is used to ensure that certain fields are present for the SharePoint ListView control to function correctly.line
CampoSpecifies a special field to include.line
FieldInternalNameUsed to identify a field when a list has an external data source. Also used when filtering on a custom field.line
FilterIndicates whether a filter should be applied to the requested view.line
filter dataData specified by a specific filter.line
filter data1Data specified by a specific filter.line
Filtrodaten2Data specified by a specific filter.line
Filtrodaten3Data specified by a specific filter.line
filtrodaten4Data specified by a specific filter.line
filtrodaten5Data specified by a specific filter.line
filtrodaten6Data specified by a specific filter.line
filterdaten7Data specified by a specific filter.line
filter data8Data specified by a specific filter.line
Filtrodaten9Data specified by a specific filter.line
filter data10Data specified by a specific filter.line
filter fieldA filter field name for a specific filter applied to the view.line
FiltroFeld1A filter field name for a specific filter applied to the view.lineI WOULD LIKE
FiltroFeld2A filter field name for a specific filter applied to the view.lineI WOULD LIKE
FilterField3A filter field name for a specific filter applied to the view.lineI WOULD LIKE
FilterField4A filter field name for a specific filter applied to the view.lineI WOULD LIKE
FiltroFeld5A filter field name for a specific filter applied to the view.lineI WOULD LIKE
FiltroFeld6A filter field name for a specific filter applied to the view.lineI WOULD LIKE
FilterField7A filter field name for a specific filter applied to the view.lineI WOULD LIKE
FilterField8A filter field name for a specific filter applied to the view.lineI WOULD LIKE
FiltroFeld9A filter field name for a specific filter applied to the view.lineI WOULD LIKE
FilterField10A filter field name for a specific filter applied to the view.lineI WOULD LIKE
filter fieldsSpecifies multiple fields that are filtered for a multiplier filter.line
FiltroFelder1Specifies multiple fields that are filtered for a multiplier filter.line
FiltroFelder2Specifies multiple fields that are filtered for a multiplier filter.line
filtrofelder3Specifies multiple fields that are filtered for a multiplier filter.line
filtrofelder4Specifies multiple fields that are filtered for a multiplier filter.line
filtrofelder5Specifies multiple fields that are filtered for a multiplier filter.line
Filter fields6Specifies multiple fields that are filtered for a multiplier filter.line
Filtrofelder7Specifies multiple fields that are filtered for a multiplier filter.line
Filter fields8Specifies multiple fields that are filtered for a multiplier filter.line
filtrofelder9Specifies multiple fields that are filtered for a multiplier filter.line
filtrofelder10Specifies multiple fields that are filtered for a multiplier filter.line
filter valueThe filter value associated with a specific filter. For example, FilterField3 matches FilterValue3, and so on.line
filter value1The filter value associated with a specific filter. For example, FilterField3 matches FilterValue3, and so on.line1
filtrowert2The filter value associated with a specific filter. For example, FilterField3 matches FilterValue3, and so on.line1
filter value3The filter value associated with a specific filter. For example, FilterField3 matches FilterValue3, and so on.line1
filter value4The filter value associated with a specific filter. For example, FilterField3 matches FilterValue3, and so on.line1
filter value5The filter value associated with a specific filter. For example, FilterField3 matches FilterValue3, and so on.line1
filter value6The filter value associated with a specific filter. For example, FilterField3 matches FilterValue3, and so on.line1
FiltroWert7The filter value associated with a specific filter. For example, FilterField3 matches FilterValue3, and so on.line1
filter value8The filter value associated with a specific filter. For example, FilterField3 matches FilterValue3, and so on.line1
filtrowert9The filter value associated with a specific filter. For example, FilterField3 matches FilterValue3, and so on.line1
FiltroWert10The filter value associated with a specific filter. For example, FilterField3 matches FilterValue3, and so on.line1
filter valuesUsed with FilterFields for multiplier filters. For example, FilterFields3 would match FilterValues3, and so on.line
FilterValues1Used with FilterFields for multiplier filters. For example, FilterFields3 would match FilterValues3, and so on.line
filter values2Used with FilterFields for multiplier filters. For example, FilterFields3 would match FilterValues3, and so on.line
Filter Values3Used with FilterFields for multiplier filters. For example, FilterFields3 would match FilterValues3, and so on.line
Filter Values4Used with FilterFields for multiplier filters. For example, FilterFields3 would match FilterValues3, and so on.line
Filter Values5Used with FilterFields for multiplier filters. For example, FilterFields3 would match FilterValues3, and so on.line
Filter Values6Used with FilterFields for multiplier filters. For example, FilterFields3 would match FilterValues3, and so on.line
Filter Values7Used with FilterFields for multiplier filters. For example, FilterFields3 would match FilterValues3, and so on.line
Filter Values8Used with FilterFields for multiplier filters. For example, FilterFields3 would match FilterValues3, and so on.line
Filter Values9Used with FilterFields for multiplier filters. For example, FilterFields3 would match FilterValues3, and so on.line
Filter Values10Used with FilterFields for multiplier filters. For example, FilterFields3 would match FilterValues3, and so on.line
FilterLookupIdUsed when filtering on a lookup field. This is the ID of the item in the outer list that has a value to filter on.line
FilterLookupId1Used when filtering on a lookup field. This is the ID of the item in the outer list that has a value to filter on.line
FilterLookupId2Used when filtering on a lookup field. This is the ID of the item in the outer list that has a value to filter on.line
FilterLookupId3Used when filtering on a lookup field. This is the ID of the item in the outer list that has a value to filter on.line
FilterLookupId4Used when filtering on a lookup field. This is the ID of the item in the outer list that has a value to filter on.line
FilterLookupId5Used when filtering on a lookup field. This is the ID of the item in the outer list that has a value to filter on.line
FilterLookupId6Used when filtering on a lookup field. This is the ID of the item in the outer list that has a value to filter on.line
FilterLookupId7Used when filtering on a lookup field. This is the ID of the item in the outer list that has a value to filter on.line
FilterLookupId8Used when filtering on a lookup field. This is the ID of the item in the outer list that has a value to filter on.line
FilterLookupId9Used when filtering on a lookup field. This is the ID of the item in the outer list that has a value to filter on.line
FilterLookupId10Used when filtering on a lookup field. This is the ID of the item in the outer list that has a value to filter on.line
just filterline
FilterOpfilter operator When filtering with operators other than Eq (Geq,Leqetc.)lineGeq
FiltroOp1filter operator When filtering with operators other than Eq (Geq,Leqetc.)lineGeq
FiltroOp2filter operator When filtering with operators other than Eq (Geq,Leqetc.)lineGeq
FiltroOp3filter operator When filtering with operators other than Eq (Geq,Leqetc.)lineGeq
FiltroOp4filter operator When filtering with operators other than Eq (Geq,Leqetc.)lineGeq
FiltroOp5filter operator When filtering with operators other than Eq (Geq,Leqetc.)lineGeq
FiltroOp6filter operator When filtering with operators other than Eq (Geq,Leqetc.)lineGeq
FiltroOp7filter operator When filtering with operators other than Eq (Geq,Leqetc.)lineGeq
FiltroOp8filter operator When filtering with operators other than Eq (Geq,Leqetc.)lineGeq
FiltroOp9filter operator When filtering with operators other than Eq (Geq,Leqetc.)lineGeq
FiltroOp10filter operator When filtering with operators other than Eq (Geq,Leqetc.)lineGeq
I WOULD LIKEThe element ID of the element whose information is being looked up.number
InplaceSearchQueryInplaceSearchQuerySearch term for a full list search.line
InplaceFullListSearchA Boolean value indicating whether a full list search exists.line
IstRSCWhether this view is a client-side rendered view.line
custom actionline
EsGroupRenderIt is used to set the IsGroupRender property of the SPView.line
The loopline
EsXslVerIf this view is a list view xslt.line
Listline
listener idline
ListViewPageUrlline
OverrideScopeUsed to override a scope on the rendered view: SPView.Scopeline
Cancel selection commandIt is used to ensure that certain fields are present in the query, regardless of whether they are explicitly included in the view.line
PageFirstRowPagination information for the first row requested. It is used to paginate list views.line
Last line of pagePaging information about the last requested line. It is used to paginate list views.line
root directoryThe folder that the view displays.line
sort fieldA field by which to sort the view.lineI WOULD LIKE
sortfield1A field by which to sort the view.lineI WOULD LIKE
ordenarcampo2A field by which to sort the view.lineI WOULD LIKE
sortfield3A field by which to sort the view.lineI WOULD LIKE
sortfield4A field by which to sort the view.lineI WOULD LIKE
sortfield5A field by which to sort the view.lineI WOULD LIKE
sortfield6A field by which to sort the view.lineI WOULD LIKE
sortfield7A field by which to sort the view.lineI WOULD LIKE
sortfield8A field by which to sort the view.lineI WOULD LIKE
sortfield9A field by which to sort the view.lineI WOULD LIKE
sortfield10A field by which to sort the view.lineI WOULD LIKE
sort fieldsSpecifies the name of the first field to sort byline
Sort field valuesSpecifies the name of the first field to sort byline
SortDirThe sort direction of an ad hoc sort applied to the view.linedescription
OrdenarDir1The sort direction of an ad hoc sort applied to the view.linedescription
OrdenarDir2The sort direction of an ad hoc sort applied to the view.linedescription
OrdenarDir3The sort direction of an ad hoc sort applied to the view.linedescription
SortDir4The sort direction of an ad hoc sort applied to the view.linedescription
OrdenarDir5The sort direction of an ad hoc sort applied to the view.linedescription
OrdenarDir6The sort direction of an ad hoc sort applied to the view.linedescription
OrderDir7The sort direction of an ad hoc sort applied to the view.linedescription
OrdenarDir8The sort direction of an ad hoc sort applied to the view.linedescription
OrdenarDir9The sort direction of an ad hoc sort applied to the view.linedescription
OrdenarDir10The sort direction of an ad hoc sort applied to the view.linedescription
vistaSpecifies the base view used to render the list.GUID3d13559e-3071-5000-76b8-8f1ca6b835f0
VerRutaSpecifies the view path used to render the list. Yeahview idis given, then theview idused and this parameter is ignored.line
visit countIf there are multiple list views on a page, this identifies one of them.line
view idSpecifies the base view used to render the list. Ad hoc parameters are applied to this view. Yes, bothVerXmlyBaseViewIdare given, then theVerXmlare used and ad hoc parameters are ignored.line
WebPartIdThe ID of the List View web part that this view displays.line

RenderListDataAsStream Body Parameter Properties

Propertydescriptionuntilexample
Add required fieldsIndicates whether required fields should be returned or notboolIt is right
AllowMultipleValueFilterForTaxonomyFieldsIndicates whether or not multi-value filtering is allowed for taxonomy fieldsboolIt is right
DatesInUtcIndicates whether we are returning the DateTime field in UTC or local time.boolIt is right
expand groupsIndicates whether or not to extend the pool.boolIt is right
SoloPrimerGrupoIndicates whether to return only the first group or not (regardless of view schema).boolIt is right
CarpetaServidorRelativoUrlSpecifies the URL of the folder from which the items will be returned.line/sites/team-a/lists/Pedidos/Europa
ImageFieldsToTryRewriteToCdnUrlsComma-separated list of field names whose values ​​should be rewritten to CDN URLslineArticle image, secondary image
OverrideViewXmlSpecifies the override XML to combine with the View CAML. Applies only toappointment/weekPart of View CAML.line<Query><Where><Gt><FieldRef Name=\"OrderCount\" /><Value Type=\"Number\">3</Value></Gt></Where></Query>
PaginationSpecifies the paging information.line
processing optionsSpecifies the type of output to return.SPRenderListDataOptionsSee the next section for possible values. You can specify multiple values ​​by adding their values
replace groupIndicates whether or not the pool should be overridden to control GroupBy throttling.boolIt is right
VerXmlSpecifies the CAML view XML.line
SPRenderListDataOptions Options
labeldescriptionWert
neitherreturn standard output0
context informationReturn list context information1
data listReturn list data (such asneither)2
listening hoursreturn list schema4
menu viewReturns HTML for the list menu8
ListContentTypeReturns information about the content types of the list. Must be combined withcontext informationbanderasixteen
FileSystemItemIdThe returned list will contain a FileSystemItemId field for each item, if possible. Must be combined withdata listbandera32
ClientFormSchemaReturns the schema of the client form for adding and editing elements64
Quick startReturns QuickLaunch navigation nodes128
faroReturns Spotlight rendering information256
displayReturns display rendering information512
show metadataReturns the view XML and other information about the current view1024
Disable automatic hyperlinkAvoid automatic hyperlinks for text fields in this query2048
EnableMediaTAUrlsEnable URLs that point to the Media TA service, such as.thumbnailUrl,.videoManifestUrl,.pdfConversionUrls4096
parent informationReturns information about the parent folder.8192
PageContextInfoReturns page context information for the current playlist16384
ClientSideComponentManifestReturn manifest information from the client-side component associated with the list (reserved for future use)32768

examples

Get article with specific ID
POST https://{site_url}/sites/team-a/_api/web/GetList(@listUrl)/RenderListDataAsStream?@listUrl=%27%2Fsites%2Fteam-a%2Flists%2FList%27&FilterField1=ID&FilterValue1=1Autorisierung: " Portador " + accessTokenAccept: "aplicación/json;odata=nometadata"...
Sort items by ID descending
POST https://{site_url}/sites/team-a/_api/web/GetList(@listUrl)/RenderListDataAsStream?@listUrl=%27%2Fsites%2Fteam-a%2Flists%2FList%27&SortField=ID&SortDir=DescAuthorization: " Portador " + accessTokenAccept: "aplicación/json;odata=nometadata"...
Get items from the specified folder
POST https://{site_url}/sites/team-a/_api/web/GetList(@listUrl)/RenderListDataAsStream?@listUrl=%27%2Fsites%2Fteam-a%2Flists%2FOrders%27Authorization: "Portador" + accessTokenAccept : "aplicación/json;odata=nometadata"Type of content: "aplicación/json"{ "parameters": { "FolderServerRelativeUrl": "/sitios/equipo-a/listas/Pedidos/Europa" }}
get list schema
POST https://{site_url}/sites/team-a/_api/web/GetList(@listUrl)/RenderListDataAsStream?@listUrl=%27%2Fsites%2Fteam-a%2Flists%2FList%27Authorization: "Portador" + accessTokenAccept : "aplicación/json;odata=nometadata"Type of content: "aplicación/json"{ "parameters": { "RenderOptions": 4 }}
Get information about list content types
POST https://{site_url}/sites/team-a/_api/web/GetList(@listUrl)/RenderListDataAsStream?@listUrl=%27%2Fsites%2Fteam-a%2Flists%2FList%27Authorization: "Portador" + accessTokenAccept : "aplicación/json;odata=nometadata"Type of content: "aplicación/json"{ "parameters": { "RenderOptions": 17 }}

create list entry

The following example shows how to create a list item.

Use

To carry out this operation it is necessary to know theListItemEntityTypeFullNameproperty of the list and pass it as the value ofuntilin the body of the HTTP request. The following is an example of a Rest call to get ListItemEntityTypeFullName

(Video) How to Use Lists in Python

OBTENGA https://{site_url}/_api/web/lists/GetByTitle('Test')?$select=ListItemEntityTypeFullNameAuthorization: "Bearer" + accessTokenAccept: "application/json;odata=nometadata"
POST https://{site_url}/_api/web/lists/GetByTitle('Test')/itemsAuthorization: "Bearer" + accessTokenAccept: "application/json;odata=verbose"Content-Type: "application/json;odata= verbose"Content-Length: {longitud del cuerpo de la solicitud como entero}X-RequestDigest: "{form_digest_value}"{ "__metadata": { "type": "SP.Data.TestListItem" }, "Title": "Test"}

Create a list item in a folder

The following example shows how to create a list item in a folder.

POST https://{site_url}/_api/web/lists/GetByTitle('Test')/AddValidateUpdateItemUsingPathAuthorization: "Bearer" + accessTokenAccept "application/json;odata=nometadata"Content-Type "application/json;odata=nometadata" X-RequestDigest "Der passende Digest für die aktuelle Seite"{ "listItemCreateInfo": { "FolderPath": { "DecodedUrl": "https://{site_url}/lists/Test/Folder/SubFolder" }, "UnderlyingObjectType": 0 }, "formValues": [ { "FieldName": "Título", "FieldValue": "Elemento" } ], "bNewDocumentUpdate": false}

Request property details

Propertydescription
listItemCreateInfoInformation about the list and the folder in which to create the item
listItemCreateInfo.FolderPath.DecodedUrlAbsolute URL of the folder in which to create the item
listItemCreateInfo.UnderlyingObjectTypeType of element to create. For more information, seeFileSystemObjectType
form valuesArray of field names and values ​​to set for the newly created element
bNewDocumentUpdateTo adjustINCORRECTto create a list entry

Reply

Nameuntildescription
200 goodbooleansuccess
{ "value": [ { "Error Message": null, "Field Name": "Title", "Field Value": "Item", "HasException": false, "ItemId": 0 }, { " Error message": null, " FieldName": "Id", "FieldValue": "1", "HasException": false, "ItemId": 0 } ]}

DieWertThe property contains the list of properties set when the list item was created.

update list item

The following example shows how a list item is updated.

Use

To carry out this operation it is necessary to know theListItemEntityTypeFullNameproperty of the list and pass it as the value ofuntilin the body of the HTTP request.

POST https://{site_url}/_api/web/lists/GetByTitle('Test')/items({item_id})Autorización: "Bearer" + accessTokenAccept: "application/json;odata=verbose"Content-Type: " application/json"Content-Length: {longitud del cuerpo de la solicitud como entero}If-Match: "{etag o *}"X-HTTP-Method: "MERGE"X-RequestDigest: "{form_digest_value}"{ "__metadata": { "tipo": "SP.Data.TestListItem" }, "Título": "TestUpdated"}

delete list entry

The following example shows how to remove an item from the list.

POST https://{site_url}/_api/web/lists/GetByTitle('Test')/items({item_id})Autorización: "Bearer" + accessTokenAccept: "application/json;odata=verbose"Content-Type: " application/json"If-Match: "{etag o *}"X-HTTP-Methode: "DELETE"

Using ETag values ​​to determine the version of documents and list items

The SharePoint REST service that references theOData Standard, UseHeader-ETagsof SharePoint lists and list items. To check the version of an item when it runs:PLACE,JOIN, oCLEARRequest, specify aETagin themif it matchesHTTP request header.

(Video) How to Add New Items to Excel Drop-down Lists Automatically

If heETagyou provide in your application does not match theETagof the document or list item on the server, the REST service returns a 412 exception as per the OData specification.

  • To force an item to be overwritten regardless of version, setETagvalor a"*".
  • If you don't specify oneETag, SharePoint overwrites the item regardless of version.

Within SharePoint, ETags only apply to SharePoint lists and list items.

See also

  • Get to know the SharePoint REST Service
  • Complemento de SharePoint-REST-OData-BasicDataOperations
  • SharePoint: Perform basic data access operations on files and folders using REST
  • Secure access to data and client object models for SharePoint Add-ins
  • Work with external data in SharePoint
  • OData Resources
  • Develop SharePoint Add-ins

FAQs

How to get list items using REST API? ›

Rest API code:

Here we are calling the createList() method to create the SharePoint List. In the metadata, we are passing the list name, base list as well as metadata. Here once you Save the page, the form will look like below where user can put the list name and click on submit which will create the list.

How do I add an item to a SharePoint list using REST API? ›

Create List Item
  1. Site Address: Provide the Site URL where your list resides.
  2. Method: POST (as we want to make changes in SharePoint)
  3. URI: api/lists/getbytitle('Documents')/items/ (here in place of documents, put your List Title)
  4. Headers: content-type: application/json;odata=nometadata. ...
  5. Body:
Mar 22, 2021

How to get data from multiple lists in SharePoint Online using REST API? ›

You can retrive data from multiple list using REST. All you could is to retrieve data from multiple list if there's any Lookup column that will link data between/among the lists. In such scenario, you will need to use the $expand clause. Search in google for expand sharepoint Rest call, that may work for you.

How to get more than 5000 items from SharePoint list using REST API? ›

This is the limitation of SharePoint REST API, you cannot get more than 5000 items from single API call. You can use filtering on columns with such conditions that will return less than 5000 items (with first filter condition).

How do I pull data from REST API? ›

The most straightforward way of accessing data from an API endpoint is simply viewing it in the browser. As long as you're connected to the internet, you should be able to preview most API's data regardless of its format.

How do I extract data from REST API? ›

If an API allows you to get the data you want to extract from a website, then you do not need regular web scraping. REST APIs usually generate output in JSON or XML format because most of programming languages can handle these formats easily.

How do I get JSON data from a SharePoint list? ›

Use the Get Items from SharePoint action in Flow and then use the "Parse JSON" action against the value retrieved from the JSON column. That should give you the data you are after.
...
Extract JSON from a SharePoint List
  1. Labels:
  2. Automated Flows.
  3. Scheduled flows.
Oct 21, 2020

How do I add bulk data to a SharePoint list? ›

How to add Bulk items to Sharepoint List
  1. Retrieve file via “Get File/Folder” .
  2. Retrieve spreadsheet content via “Read Range”. ...
  3. Retrieve the Sharepoint list information via “Get List Info”. ...
  4. Use “Add List Items” to add your Excel DataTable.
Jan 12, 2022

How do I embed a list in SharePoint? ›

How to display lists and libraries from other SharePoint sites
  1. Navigate to another site where you want to embed a list or library, and click the Edit button to edit the page.
  2. Click the plus sign to add web parts and choose Embed Web Part.
  3. Paste the URL of the Document Library inside the Embed window.
Jan 11, 2023

CAN REST API handle multiple requests? ›

If you need to make multiple API requests, you can send these API requests concurrently instead of sending them one by one. Sometimes, we need to make multiple API calls at once. For example, let's say we have an array, and we want to make an API request for each element of that array.

How do I pull data from a SharePoint list to SQL Server? ›

4) Export to Excel first and then load to SQL Server
  1. Actions > Export to SpreadSheet.
  2. Save the Excel file.
  3. Open your SQL database with SQL Management Studio.
  4. Right click on your database > Tasks > Import Data.
  5. Select your Excel file as the source, and specific table as destination.
  6. Fill all other needed options.

How do I fetch data from a SharePoint list? ›

Retrieving SharePoint List Data
  1. Drag SharePoint action and select “Create Session” activity. ...
  2. Drag the SharePoint action and select the “Get list items” activity. ...
  3. Drag the SharePoint action and select the “End session” activity.
Oct 22, 2021

How do you handle millions of request in REST API? ›

To handle 'millions of request' the system must be deployed on multiple web servers behind a load-balancer that would round robin between each. if the system is hitting a datastore, a second level cache(ehcache, memcache,etc.) should be used to reduce load on the datastore.

How do I manage large lists and libraries in SharePoint? ›

Below mentioned are the best possible ways to manage large lists and libraries in SharePoint.
  1. Use Modern View. The modern view in SharePoint is the best to display a large number of items. ...
  2. Add indexes. ...
  3. Edit the list view. ...
  4. OneDrive Sync. ...
  5. Calculated Columns. ...
  6. Custom Made Views. ...
  7. Bulk Edit. ...
  8. Apply Unique Permissions.
Aug 13, 2020

Is there a limit to SharePoint lists? ›

A list can have up to 30 million items and a library can have up to 30 million files and folders. When a list, library, or folder contains more than 100,000 items, you can't break permissions inheritance on the list, library, or folder. You also can't re-inherit permissions on it.

How do I write a SQL query in REST API? ›

To run a SQL statement through REST, you POST a JSON document that includes the SQL statement to execute against the /api/servers/{alias}/databases/{dbname}/sql URI endpoint.

Is REST API a database? ›

An API is not a database or web server. However, it provides secure access to both. When an application or client requests some information (data) to the API, the API redirects the request to the appropriate source and passes the received response to the client.

What is the best way to send data REST API? ›

To send data to the REST API server, you must make an HTTP POST request and include the POST data in the request's body. You also need to provide the Content-Type: application/json and Content-Length request headers.

How do I import data from REST to data? ›

Go to Source Data tab and Add new source application and select REST API application type. If you have created already another similar REST API data source then you can export its definition and paste it in Import definition to create new REST API source application with the same parameters.

How does a REST API store data? ›

Caching saves server resources and bandwidth while decreasing page load time, which is why most large websites do it. REST APIs are created with data caching in mind. When a server sends its response to a client, the response should indicate whether the resource provided can be cached, and for how long.

Can we pass a list to a JSON? ›

We can convert a list to the JSON array using the JSONArray. toJSONString() method and it is a static method of JSONArray, it will convert a list to JSON text and the result is a JSON array.

How do I turn a list into a JSON? ›

How to convert a list to JSON in python? You can use the json. dumps() method to convert a Python list to a JSON string. This function takes a list as an argument and returns the JSON value.

Can a JSON file be a list? ›

JSON is built on two structures:

In most languages, this is realized as an array, vector, list, or sequence.

How many items can be stored in SharePoint list? ›

You can store up to 30 million items or files in a list or library. Filtered views of large lists have a similar experience to other lists. However, when a list view shows more than 5000 items, you may run into a list view threshold error.

Can SharePoint lists do calculations? ›

You can use formulas and functions in SharePoint lists or libraries to calculate data in a variety of ways.

How do I list more than 30 rows in SharePoint? ›

Hi, navigate to the list settings, edit the view to update, go to 'Item Limit' section, and change the default value from 30 to 100. If you are using the modern version, there won't be paging, instead when you scroll after 30 or 100 items it will load more items, if it is a classic view then you can see the paging.

How do I turn a SharePoint list into a form? ›

Create a custom form
  1. In your SharePoint site, browse to the Projects list.
  2. To create and manage flows for a list or a library, from the command bar, on the list or library page, select Integrate > Power Apps. More options appear: ...
  3. Select Customize forms. The Power Apps studio appears and loads your form onto the canvas.
Oct 3, 2022

How do lists work on SharePoint? ›

A list in SharePoint Online is a collection of data displayed in rows and columns. It is very similar to a spreadsheet or a simple database. The rows in a list are called list items. The columns can be called fields, properties, or metadata.

What is list template in SharePoint? ›

Reuse customized Microsoft SharePoint lists with list templates. A template saves fields, formulas, and formatting, and optionally, data as well. Templates can be downloaded for archiving or uploaded to another site.

What are the limitations of REST API? ›

The REST API limits the rate of requests you can make to 15 requests per second. If you are performing certain operations that are resource-intensive, you may adversely affect performance of your system.

How to handle 1,000 requests per second? ›

To handle high traffic, you should setup Load Balancer with multiple node/instances. Better to go with Auto Scaling on Cloud server. It will increase the instances as per high load (number or request) and again decrease the instances when there will be low number of requests. Which is cost effective.

How do I combine two API responses? ›

Merge data from API-1 and API-2 and store on local system
  1. Drag the ReplaceTextProcessor and configure the replacement value property field. ...
  2. Drag the UpdateAtrribute processor to update the attribute value by adding the property as filename and value as any name with any extension type (optional) to store the file.

How do I sync a SharePoint list with SQL database? ›

Below mentioned are the steps that we will follow in this article:
  1. Create SharePoint list.
  2. Create Azure SQL DB and table.
  3. Generate Client ID and Secret & grant access at site level.
  4. Create Azure function app.
  5. Create Log Analytics.
  6. Create Microsoft Flow for SP to Azure SQL Sync (Single item)
Jan 22, 2019

Can I connect SharePoint list to SQL Server? ›

Please follow the below steps.
  • Connect to the SharePoint Online site and get the reference of the SharePoint list.
  • Connect to the SQL database using a connection string and execute the SQL query.
  • Iterate through all the rows in the data table and create items in SharePoint List.
Dec 27, 2019

How do I access a SharePoint list using REST API? ›

To access SharePoint resources using REST, construct a RESTful HTTP request by using the OData standard, which corresponds to the desired client object model API. For example: CSOM. http.

What is the difference between SharePoint Online list and SharePoint list? ›

The difference between Sharepoint List and Online List is that the online list connector can only be used to connect to Sharepoint Online, but Sharepoint List can be used in both Sharepoint Online and on-premise Sharepoint.

How do I copy data from one SharePoint list to another SharePoint list? ›

On the top-level site of the site collection containing the list that you want to copy, click Site Settings. In the Galleries section, click List templates. On the List Template Gallery page, select the check box next to list template that you want to export. In the ribbon Click Download a Copy.

Should REST API always return 200? ›

However, they told me specifiying status code like 400, 404, 300, is part of RESTful API, and returning always 200 is the right status code because the server responded and it is alive. APIs, always have to return 200 except 500. Because when the server dies, it can't return anything.

How many requests can a REST API handle? ›

In the API Console, there is a similar quota referred to as Requests per 100 seconds per user. By default, it is set to 100 requests per 100 seconds per user and can be adjusted to a maximum value of 1,000. But the number of requests to the API is restricted to a maximum of 10 requests per second per user.

How to improve REST API performance? ›

One of the best ways to improve API performance is by caching to serve content faster. If there are concurrent requests frequently producing the same response, then the response can be cached to avoid excessive database queries and provide quick access.

What is the best way to organize files in SharePoint? ›

Follow these best practices:
  1. Use metadata to tag and find your documents.
  2. Whenever possible, centralize and reuse.
  3. Design a site architecture that accounts for the 5,000 list view threshold.
  4. Don't use SharePoint to replace your relational database.
  5. Assign permissions to groups—never to users directly.
Jan 25, 2022

What are the limitations of Microsoft lists? ›

30 000 000 - maximum number of list items - realistically you should limit the number of list items below 200 000 items to guarantee high performance. 5 000 - list view threshold. 12 columns - maximum number of list columns in the view of the specific type: people, lookup, and managed metadata.

Can multiple people edit a SharePoint list? ›

With Microsoft 365 and OneDrive or SharePoint, multiple people can work together on a Word document, Excel spreadsheet, or PowerPoint presentation. When everyone is working at the same time, that's called co-authoring.

What is 5000 items limit SharePoint online? ›

How do I overcome the SharePoint 5000 item limit threshold?
  • Set filters through “Modify list view” and limit the number of items in the view to less than 5000 to mitigate this issue. ...
  • Archive old list items or files, either by moving to a new list or a folder inside the same list.
  • Add Indexed columns to the list.
Oct 13, 2022

Can multiple users edit a SharePoint list at the same time? ›

When a user wants to work on a document in Word, PowerPoint, OneNote, Visio or one of the Office Web Apps, they open it from SharePoint Server, as usual. If another user already has the document open, both users can edit the document at the same time.

How to get item ID in SharePoint list using REST API? ›

Get List Item By Id in SharePoint using REST API
  1. REST-API is based on OData (Open Data) Protocol and hence it doesn't require any dll or JS library to run the commands on the SharePoint objects.
  2. REST-API calls require proper end-point URL and proper Header implementation in your REST call.

How do I find my API list? ›

Best Websites To Find/Discover APIs
  1. RapidAPI.com.
  2. ProgrammableWeb.
  3. Public APIs.
  4. API List.
  5. API For That.
  6. APIs. guru OpenAPI Collection.
  7. Google APIs Discovery Service.
Jan 8, 2021

How do I get data from REST API in Excel? ›

To import this on excel go to Data>Get Data>From other Sources> From Web or simply Data>From Web. Paste the API URL on the prompt then click OK. Then select Into Table on the Convert tab. Select the Value of Data then right click>Drill Down.

How do you get data from API and show it as list in flutter? ›

Fetch and display the data with Flutter.
  1. Add the http package. The http package provides the simplest way to fetch data from the internet. ...
  2. 2. Make a network request. ...
  3. Convert the response into a custom Dart object. ...
  4. Fetch the data. ...
  5. Display the data.

How does SharePoint REST API work? ›

The REST API is implemented as Data-centric web service based on the Open Data Protocol or OData. The way these web services work, use each resource in the system is addressable by a specific URL that you pass off to the server. Let us look at this in Internet Explorer in which SharePoint site is open.

What are CRUD operations with REST API? ›

CRUD stands for Create, Read, Update, and Delete, which make up these four fundamental operations. Because REST API calls invoke CRUD operations, understanding their relationship with one another is important for API developers and data engineers.

How do I find REST API endpoints? ›

Through the dataset URL: You can get the API endpoint by simply taking the dataset's UID and replacing it in this string: https://domain/resource/UID.extension *where the extension is the data format you's like to pull the data as. For a full list of extension formats please go here.

How do I list an API? ›

Access List APIs with GET HTTP requests. List APIs return a list of records that match the criteria that is specified in the request parameters. REST List requests use get Name List APIs, where Name is the type of resource that you specify in the request.

What are endpoints in API? ›

Simply put, an endpoint is one end of a communication channel. When an API interacts with another system, the touchpoints of this communication are considered endpoints. For APIs, an endpoint can include a URL of a server or service.

Can Excel connect to a REST API? ›

A REST API for Excel Services enables operations against Excel workbooks by using operations specified in the HTTP standard. This allows for a flexible, secure, and simpler mechanism to access and manipulate Excel Services content.

Can we call REST API from Excel? ›

You can use the Excel REST API in Microsoft Graph to extend the value of your Excel data, calculations, reporting, and dashboards.

How do you pass JSON data to List in flutter? ›

So How we are going to do that?
  1. Step 1: Create a PODO. First of all, we have to create a PODO (Plain Old Dart Object) for a particular article. ...
  2. Step 2: Make the network request. I am using the NewsApi to retrieve the JSON data. ...
  3. Step 3: Decode the response. ...
  4. Step 3: Map the JSON objects to Dart Objects.

How do I add a JSON response to a List in flutter? ›

In Flutter, you can use a separate Isolate. This recipe uses the following steps: Add the http package. Make a network request using the http package.
...
Move this work to a separate isolate.
  1. Add the http package. ...
  2. 2. Make a network request. ...
  3. Parse and convert the JSON into a list of photos. ...
  4. Move this work to a separate isolate.

How to fetch data from API in JSON? ›

To fetch JSON from the server using the Fetch API, you need to use the JavaScript fetch() method and then call the response. json() method to get the JSON data as a JavaScript object. The response. json() method reads the data returned by the server and returns a Promise that resolves with a JSON object.

Videos

1. ArrayList in Java Tutorial
(Alex Lee)
2. Customize SharePoint List Forms using JSON Formatting (1)
(Reza Dorrani)
3. Approvals in Microsoft Teams | Full Tutorial
(Kevin Stratvert)
4. Create SMART Drop Down Lists in Excel (with Data Validation)
(Leila Gharani)
5. Advanced Excel - Data Validation and Drop-Down Lists
(Technology for Teachers and Students)
6. To-Do List Overload! How to Manage Too Many Tasks
(Simpletivity)

References

Top Articles
Latest Posts
Article information

Author: Saturnina Altenwerth DVM

Last Updated: 11/11/2023

Views: 5697

Rating: 4.3 / 5 (44 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Saturnina Altenwerth DVM

Birthday: 1992-08-21

Address: Apt. 237 662 Haag Mills, East Verenaport, MO 57071-5493

Phone: +331850833384

Job: District Real-Estate Architect

Hobby: Skateboarding, Taxidermy, Air sports, Painting, Knife making, Letterboxing, Inline skating

Introduction: My name is Saturnina Altenwerth DVM, I am a witty, perfect, combative, beautiful, determined, fancy, determined person who loves writing and wants to share my knowledge and understanding with you.