API to determine sharepoint site's search setting - sharepoint

Is it possible to determine the search setting for a sharepoint site (i.e. whether the site is allowed to appear in search results) using any sharepoint API (graph/rest/soap)?

I am not aware (such feature exists or exposed to developers) in any of the APIs which are available in Office 365s Enterprise Search center. Being said that you can create a new Microsoft User voice, so that they can consider implementing it.

Related

Microsoft Graph API - How to Filter SharePoint sites by Site Type?

SharePoint Admins in Microsoft 365 can create Team Sites and Communication Sites using the admin center.
In addition, individual users can have Personal Sites (Otherwise known as My Sites)
Using the Microsoft Graph .NET SDK I can retrieve all sites like this:-
await client.Sites.Request().GetAsync();
However this appears to include all Team, Personal and Communication Sites. Is there a way to limit the request to only one type of site, or detect the type of each site returned from the query? I could not find anything in the documentation about this.
Edit: If there's a way to get this information via SharePoint CSOM, I would be interested in that too
Unfortunately this is not available as of now but there is a uservoice already raised. Please upvote it so that this feature may be implemented in the future.
I don't know if it can help you but I found a workaround how to differentiate between a team/communication site and a personal site.
A personal site contains in the WebUrl field the string "my.sharepoint.com/personal/", then after you make the call: var sites = await client.Sites.Request().GetAsync(); you can use this filter to retrieve only personal site: var personalSites = sites.Where(s => s.WebUrl.Contains("my.sharepoint.com/personal/")); (Microsoft does not allow to use a filter on this request directly, so this is the reason why I used the filter after fetching all sites.)

Search for Content Across SharePoint Sites

Currently I'm using: /v1.0/sites/{site-id}/drive/root/search(q='{search-text}') but I would like to search across all the sites I have access to.
Is there a Microsoft Graph API which can search a keyword on all sites a user can access in SharePoint without giving site id?
There's no Graph API for a global content search at the moment.
However you can leverage the SharePoint Search API.

Force Sharepoint to classic view

Where can I force SharePoint 2013 online to always use classic view for every user?
I'm unable to find a setting that will only display the SharePoint 2013 online pages in classic view.
Refer to Microsoft's documentation here:
Change the default experience for all lists and document libraries (for administrators)
Choose Admin centers and then SharePoint
Choose Settings
Next to SharePoint Lists and Libraries experience, select either Classic experience or New experience (auto-detect).

How to retrieve data from SharePoint?

I have a web application. When the user clicks on a button in my web application, I'd like to retrieve data from SharePoint on behalf of the user. I have read quite a few articles on SharePoint but I'm still not sure how to proceed. Should I create a provider hosted SharePoint App and use the SharePointREST API? Thank you in advance for your help.
You don't need to create a Provider to use the SharePoint Rest Services.
Quoting http://msdn.microsoft.com/en-us/library/office/jj164022(v=office.15).aspx :
One advantage of using REST is that you don’t have to add references to any SharePoint 2013 libraries or client assemblies. Instead, you make HTTP requests to the appropriate endpoints to retrieve or update SharePoint entities, such as webs, lists, and list items. See Get started with the SharePoint 2013 REST service for a thorough introduction to the SharePoint 2013 REST interface and its architecture.
Inside the page you will find videos and code examples that will help you to connect and execute operations.
It's Correct. Data in SharePoint is Stored in Lists or Libraries (to files).
You can use the Client Object Model, to get data remotely from a SharePoint Server (on-premise or Online). The Client Object Model can be used through Assemblies (DLL files) or REST services provided by SharePoint. Generally you should know the location of the data you are going to get, that is, as I initially mentioned, the data in SharePoint are stored in Lists or Libraries, therefore you must know the name of the List or Library Additional Site or Sub-site of the List or Library is.
If the name of the list where the information is stored is "employees" and the HR website, the URL could be formed as follows:
http://spserver.company.com/HR/Employees
For REST services, simply complete URL of the list you want to see, so that you retrieve the information from the list. If you want to apply filters, sorting, to retrieve specific columns, you must do it through CAML queries which the add on REST service call.

Is it possible to create a list in WSS 3.0 based on a custom template using SharePoint web services?

I want to create a SharePoint list using SharePoint web services (instance is SharePoint Services v3.0). That list should be built from the custom list template that I have created previously. Browsing through MSDN documentation resulted in the following resolutions:
services.ListsService.AddList(title, description, templateID);
or
services.ListsService.AddListFromFeature(title, description, featureGUID, templateID);
Now, if we take a look at the first implementation, there is a problem as the templateID doesn't exist for my custom template - it refers to the default ones instead.
The second implementation is no good either as I need the templateID again, but I also need the feature GUID which I have no idea how to get. Could anyone help please? Thanks.
It has been confirmed to me from people from Microsoft that, unfortunately, it is not possible to utilize features to create a SharePoint list using SharePoint web services. It can be either done by developing custom web service, or by using Object Model.

Resources