Namespace: microsoft.graph.networkaccess
Important
APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Validate the web categorization of a Uniform Resource Locator (URL) in Global Secure Access (GSA) web content filtering.
Permissions
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
| Permission type |
Least privileged permissions |
Higher privileged permissions |
| Delegated (work or school account) |
NetworkAccess.Read.All |
Not available. |
| Delegated (personal Microsoft account) |
Not supported. |
Not supported. |
| Application |
NetworkAccess.Read.All |
Not available. |
HTTP request
GET /networkAccess/connectivity/getWebCategoryByUrl(url='@url')?@url=url
Function parameters
In the request URL, provide the following query parameters with values.
| Parameter |
Type |
Description |
| url |
String |
Uniform Resource Locator (url). Required. |
Request body
Don't supply a request body for this method.
Response
If successful, this function returns a 200 OK response code and a webCategory in the response body.
Examples
Request
The following example shows a request.
GET https://graph.microsoft.com/beta/networkaccess/connectivity/getWebCategoryByUrl(url='@url')?@url=msn.com/en-us/sports
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://free.blessedness.top/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.NetworkAccess.Connectivity.MicrosoftGraphNetworkaccessGetWebCategoryByUrlWithUrl("{url}").GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.@url = "msn.com/en-us/sports";
});
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphnetworkaccess "github.com/microsoftgraph/msgraph-beta-sdk-go/networkaccess"
//other-imports
)
request@url := "msn.com/en-us/sports"
requestParameters := &graphnetworkaccess.ConnectivitygetWebCategoryByUrlWithUrlRequestBuilderGetQueryParameters{
@url: &request@url,
}
configuration := &graphnetworkaccess.ConnectivitygetWebCategoryByUrlWithUrlRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://free.blessedness.top/en-us/graph/sdks/create-client?from=snippets&tabs=go
url := "{url}"
microsoftGraphNetworkaccessGetWebCategoryByUrl, err := graphClient.NetworkAccess().Connectivity().MicrosoftGraphNetworkaccessGetWebCategoryByUrlWithUrl(&url).Get(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
var result = graphClient.networkAccess().connectivity().microsoftGraphNetworkaccessGetWebCategoryByUrlWithUrl("{url}").get(requestConfiguration -> {
requestConfiguration.queryParameters.@url = "msn.com/en-us/sports";
});
const options = {
authProvider,
};
const client = Client.init(options);
let webCategory = await client.api('/networkaccess/connectivity/getWebCategoryByUrl(url='@url')')
.version('beta')
.get();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\NetworkAccess\Connectivity\Microsoft\Graph\Networkaccess\GetWebCategoryByUrl(url='{url}')\GetWebCategoryByUrlWithUrlRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new MicrosoftGetWebCategoryByUrlWithUrlRequestBuilderGetRequestConfiguration();
$queryParameters = MicrosoftGetWebCategoryByUrlWithUrlRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->@url = "msn.com/en-us/sports";
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->networkAccess()->connectivity()->microsoftGraphNetworkaccessGetWebCategoryByUrlWithUrl('{url}', )->get($requestConfiguration)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.network_access.connectivity.microsoft.graph.networkaccess.get_web_category_by_url(url='{url}').get_web_category_by_url_with_url_request_builder import GetWebCategoryByUrlWithUrlRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
# To initialize your graph_client, see https://free.blessedness.top/en-us/graph/sdks/create-client?from=snippets&tabs=python
query_params = GetWebCategoryByUrlWithUrlRequestBuilder.GetWebCategoryByUrlWithUrlRequestBuilderGetQueryParameters(
@url = "msn.com/en-us/sports",
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.network_access.connectivity.microsoft_graph_networkaccess_get_web_category_by_url_with_url("{url}").get(request_configuration = request_configuration)
Response
The following example shows the response.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#microsoft.graph.networkaccess.webCategory",
"name": "Sports",
"displayName": "Sports",
"group": "GeneralSurfing"
}