--- title: UriMatcher - Scoped description: Provides a method to check if a URI matches specified criteria for scheme, host, path, fragments, and presence of query parameters.Instantiates a new UriMatcher object.Checks if a URI matches specified criteria for scheme, host, path, fragments, and presence of query parameters. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/api-reference/server-api-reference/UriMatcherScopedAPI.html release: australia product: Server API Reference classification: server-api-reference topic_type: concept last_updated: "2026-03-12" reading_time_minutes: 2 breadcrumb: [Server API reference, API reference, API implementation and reference] --- # UriMatcher- Scoped Provides a method to check if a URI matches specified criteria for scheme, host, path, fragments, and presence of query parameters. The UriMatcher API requires the REST API Provider \(com.glide.rest\) plugin, which is activated by default. This API is provided within the `sn_ws` namespace. **Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md) ## UriMatcher - UriMatcher\(\) Instantiates a new UriMatcher object. |Name|Type|Description| |----|----|-----------| |None| || Instantiates a UriMatcher object. ``` var matcher = new sn_ws.UriMatcher(); ``` ## UriMatcher - match\(String uri, String scheme, Array hosts, Array paths, Array fragments, Boolean disallowQueryParameters\) Checks if a URI matches specified criteria for scheme, host, path, fragments, and presence of query parameters.
| Name | Type | Description |
|---|---|---|
| uri | String | URI to test against the specified criteria. |
| scheme | String | Protocol used in the URI.Valid values: - http - https |
| hosts | Array | List of allowed hosts in the URI.The URI must use one of the allowed hosts to be considered a match. |
| paths | Array | Optional. List of allowed paths in the URI.The URI must use one of the allowed paths to be considered a match, and the allowed path must be the full path used in the URI. For example, if the allowed path is `/path1`, a URI with the path `/path1/more` isn't considered a match. **Note:** Paths must start with `/`. Default: Any path is allowed. |
| fragments | Array | Optional. List of allowed fragments in the URI. The URI is considered a match even if it doesn't contain any of the allowed fragments. The URI is only considered not matching if it contains fragments that aren't in the allowed list. Default: Any fragment is allowed. |
| disallowQueryParameters | Boolean | Optional. Flag that indicates whether query parameters are allowed in the URI.Valid values: - true: Query parameters aren't allowed. If query parameters are included in the URI, an error occurs. - false: Query parameters are allowed. Default: false |