Search across a SharePoint tenant for sites that match keywords provided.
The only property that works for sorting is createdDateTime. The search filter is a free text search that uses multiple properties when retrieving the search results.
GET https://graph.microsoft.com/v1.0/sites?search={query}
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var result = await graphClient.Sites.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Search = "{query}";
});
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new SitesRequestBuilderGetRequestConfiguration();
$queryParameters = SitesRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->search = "{query}";
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->sites()->get($requestConfiguration)->wait();
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(request_adapter)
query_params = SitesRequestBuilder.SitesRequestBuilderGetQueryParameters(
search = "{query}",
)
request_configuration = SitesRequestBuilder.SitesRequestBuilderGetRequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.sites.get(request_configuration = request_configuration)