33
votes
Accepted
SharePoint Online REST API Authentication In POSTMAN
Answering my own question in case it helps somebody.
As mentioned in comment by @SharePointer you need to register an app in Azure AD in order to authenticate against it. That app that you register ...
16
votes
Accepted
REST API call in SharePoint gets result, but when returns result becomes undefined
You have to learn all about the async nature of REST calls.
It is like when you order someone to get you a coffee:
the request is Asynchronous; you do not get an immediate response
Your function ...
15
votes
Accepted
Make CAML query with in rest api call
There are a lot of things to cover in your question.
First, JSOM and REST are different things. JSOM is the JavaScript version of the Client Object Model. This is an API designed to be similar to the ...
15
votes
Accepted
When SharePoint list with 5000+ items queried with ID returns expected result but with any other column gives threshold error
Add indexes to columns
Lets say it is sorting by category and filtering by status, then both those fields need to be indexed. It’s very easy to add something a column to the index.
Go the list ...
14
votes
Accepted
How to get listitem counts via rest api
You could use the rest API below as mentioned.
/_api/web/lists/getbytitle('<list title>')/ItemCount
You will get item count of any list or library
you have one more option to retrieve both
...
12
votes
SharePoint Online REST API Authentication In POSTMAN
I've successfully achieved it using this tutorial.
Sharepoint configuration part
Register a new app by
following https://YourTenant.sharepoint.com/_layouts/15/appregnew.aspx link
generating Client ...
12
votes
Accepted
SharePoint Online Rest API - Filter by boolean (yes/no)
Assuming the column is a Yes/No column, and not a column with "Yes" and "No" text, the following works for me in SharePoint Online:
Returns false items:
_api/web/lists/getbytitle('TestList')/items?$...
10
votes
Accepted
When using SharePoint 2010 rest api - /_vti_bin/listdata.svc/UserInformationList, what is difference between Name and Account
The prefix i:0#.w| before the username is to identify the type of authentication.
i : for an identity claim, otherwise it will be 'c'
# : for user logon name otherwise it will be $ : email address ...
10
votes
The property '__metadata' does not exist on type 'SP.Data...'
One case when this error often happens is when you set ContentType request header as "application/json" instead of "application/json;odata=verbose".
9
votes
Accepted
Get installed apps using REST api
When you add an App to your site, basically it adds an sub-site to your site. It is not visible under site content because it is hidden. For this kind of sub-site, WebTemplate is 'APP'. So you can ...
9
votes
When SharePoint list with 5000+ items queried with ID returns expected result but with any other column gives threshold error
The ID column is a built-in column (in table AllUserData) that is shared by all list items from all lists. In the SQL table it is naturally indexed in the SQL sense.
User-defined columns are not ...
9
votes
Accepted
Exclude folder from results in SharePoint REST API
A few more options actually available:
items?$top=1000&$select=Title,FileLeafRef,FieldValuesAsText/FileRef,FieldValuesAsText/FileRef/Title&$expand=FieldValuesAsText&$filter=FSObjType ...
8
votes
Accepted
How to use SharePoint RESTful web services with Node.js?
It depends heavily on your requirements and on the app type you are going to build (web application or just console daemon, azure function, etc.). Does it require user context or not?
Here are the ...
8
votes
Accepted
Approaches for using REST API on list with more than 5K items
Is there any way we can filter a list (with REST API) with more than 5k items in it?
Answer - Please note that 5k limit is for query, if your query is going return data more than 5k items as per your ...
8
votes
The query string "accountName" is missing or invalid
I also had the same issue but resolved it finally;
Resolution:
all the characters should be encoded after @v= (as below)
@v=%27i%3A0%23.f%7Cmembership|user@domain.com%27
Full URL will be:
http:/...
8
votes
Accepted
Insert multiple users and groups in a user field of a Sharepoint Online list using Pnp-Js-Core
You can use it as below:
$pnp.sp.web.lists.getByTitle("Test").items.add({
Title: "test",
MultiUserId: {
results: [ 9, 6 ] // User/Groups ids as an array of numbers
}
}).then(...
8
votes
Retrieve all sites and all subsites from the SharePoint REST API
You need to use STS_Site and STS_Web both in your queryText.
Your REST API endpoint should be as below:
https://{mycompany}.sharepoint.com/_api/search/query?
querytext='contentclass:STS_Site ...
8
votes
Accepted
Deleting Files with REST API
Verify the array and the URLs. I modified your script using something similar the following direct API requests so I could do a quick test, and I got your result. My error was an incorrect URL to the ...
8
votes
Accepted
Filter Created in SP REST API
SharePoint REST API endpoints take ISO formatted date string for filtering.
Try using below query for filtering on Date Field:
To check greater than 2018/10/05:
https://[tentat]/sites/[site]/...
7
votes
REST API Limitations On Premise and Workarounds
Limitation number #2 and #3 mentioned by OP is not correct. Find the explanation in the last part of the answer.
REST API Limitations-Workarounds
Nested query is not supported. Multiple REST call is ...
7
votes
Accepted
How to get the URL property in a Promoted Links list
You have to drill down into the LinkLocation using:
item[i].LinkLocation.Url
As each link is an object consists of Url and Description.
7
votes
SharePoint get "Modified By" field from Library using REST API
You can use below syntax
$select=Editor/Title&$expand=Editor/Id
You query will turn into
https://servername/_api/web/lists/getbytitle('MyLibrary')/Items?$select=Title,InternalName,Editor/Title&...
7
votes
SharePoint get "Modified By" field from Library using REST API
You need to use expand with the this Editor field.
In the $expand, you should specify the person field you want to expand.
$select=Editor/Title&$expand=Editor
Try below query:
https://...
7
votes
REST API call in SharePoint gets result, but when returns result becomes undefined
There is one more way to implement. Please refer below code:
var url = "/_api/Web/Lists/GetByTitle('LISTNAME')/Items?$select=ID,FIELD1,FIELD2,FIELD3";
getItems(url).then(getItemsSuccess, ...
7
votes
Accepted
SharePoint Online REST API List Items Paging
Needed URI encoding on the $shiptoken parameters - related to this post: Paging using REST/OData with SP 2013
tenant.sharepoint.com/conversations/_api/web/lists/getbytitle('Posts')/items?%24skiptoken=...
7
votes
SharePoint Online REST API Authentication In POSTMAN
Just adding this here since the Azure Portal is slightly different now.
Login to Azure Portal at https://portal.azure.com for your O365 Tenant
Either use the Search at the top of the page for App ...
6
votes
Accepted
Sharepoint REST api - Recursively fetch all folders in a document library -
I think you should use CAML query with REST API.
Here you can find your solution on this answer by Vadim Gremyachev
Sample code provided by Vadim Gremyachev:
function getListItems(webUrl,listTitle, ...
6
votes
REST API Getting Fields from an Lookup List
When creating lookup field, you can select which field from source list you want to show. The number of such fields is limited by field type. For example you can create a lookup with lookup field ...
6
votes
When SharePoint list with 5000+ items queried with ID returns expected result but with any other column gives threshold error
The reason behind working on ID column and throwing error on other column type is very simple and clear.
We aware about the fact that if we want to fetch data or filter data from list containing more ...
6
votes
Access denied. You do not have permission to perform this action or access this resource (REST API SharePoint Designer)
Make sure that the current user added to a group that has the following permission:
Use Remote Interfaces - Use SOAP, Web DAV, the Client Object Model
or SharePoint Designer interfaces to ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
sharepoint-rest-api × 1620sharepoint-online × 774
rest × 350
javascript × 203
sharepoint-server × 150
2013 × 127
sharepoint-enterprise × 119
list × 98
spfx × 64
sharepoint-designer × 63
document-library × 61
jquery × 59
jsom × 54
api × 45
error × 41
development × 39
jquery-ajax × 38
office-365 × 37
modern-experience × 36
designer-workflow × 35
2016 × 35
spfx-webparts × 35
flow × 33
power-automate × 33
workflow × 31