Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Using the Representational State Transfer (REST) interface provided by SharePoint
9
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 content …
8
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://servername/_ …
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 …
6
votes
Accepted
Rest API to pull all list items that uses a unique Content Type under a specific URL
The best way to get all items belonging to a content type under a site collection would be to use the Search REST API. Since data will already be indexed, it is the fastest way to get items.
You can …
5
votes
Accepted
How to make multiple ajax call synchronously?
You can use the jQuery's when to get data as below:
function SPData() {
function getJsonDataAsync(url) {
// returning the $.ajax object is what makes the next part work...
return …
5
votes
Unable to get the label of term using SPFx with Rest API
You dont need to make it multi-valued anymore to get the label values.
You can use the new first-class RenderListDataAsStream API to get the taxonomy label values. Instead of a standard GET call to t …
5
votes
Accepted
Rest API Post Request Returns '403 Forbidden'
You can directly use the FormDigestValue in the RequestDigest header in Modern pages.
The __REQUESTDIGEST is a hidden HTML element which is not present in modern pages. So, it had tripped up your cod …
4
votes
Accepted
spfx download file with rest api
Actually, this has got nothing to with SPFx.
HTTP does not support more than one file download at once. So you can create a temporary set of hidden iframes, initiate download by GET or POST inside o …
4
votes
Accepted
Multi line text field in REST API filter url
Try it as below:
_spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/GetByTitle('Site')/items?$select=Title,Keywords&$filter=substringof('test',Keywords)
If that doesnt work, you need to create a …
4
votes
How to set and get people picker fields of a list using REST API?
To get people field try below code:
//Here users is a people of group field
var users = [];
$.ajax({
url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('employees')/items?$se …
4
votes
Accepted
Update attachment of list item using rest api is failing
Unfortunately there is no API to overwrite the list attachment, so you need to delete the attachment first before uploading it.
Try the below sample code:
function checkFileExists(){
$.ajax({
…
4
votes
Accepted
How to fetch user profile image from Azure Active Directory from SharePoint Online page?
In Graph API, you can use the below endpoint to fetch photo from Azure AD:
https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}/photo/$value
So, for example, you have user's email address …
3
votes
Accepted
SharePoint REST API does not return all the fields from SharePoint Picture Library
Try it as below:
_spPageContextInfo.webAbsoluteUrl + "/_api/web/getfolderbyserverrelativeurl('" + listName + "')/files" + filter&$expand=ListItemAllFields
You need to add ListItemAllFields in the R …
3
votes
Accepted
SharePoint REST orderby ArticleStartDate not working
You also need to expand the property inside the ListItemAllFields as ListItemAllFields/ArticleStartDate.
The full url would be somewhat as below:
_spPageContextInfo.webAbsoluteUrl + "/_api/web/GetFo …
3
votes
Accepted
SharePoint Framework jQuery REST POST returns 400 Bad Request error
Update
Thanks to @wjervis for pointing out.
To update list item using REST API, the endpoint would be as below:
https://[site URL]/_api/web/lists/GetByTitle('List Title')/items(ID)
where ID = it …