---
title: "API queries for objects containing a slash"
description: "API queries for objects containing a slash may result in errors when the slash is not properly encoded. The solution is to double url-encode the slash by using \"%252F\" instead of a single \"%2F\" in the query URL."
url: "https://docs.itrsgroup.com/docs/faq/op5/360011221177-op5-monitor-api-queries-for-objects-containing-a-slash/index.html"
---
If you attempt an API query requesting information about an object that contains a slash, you may get an error. Here's a curl example requesting the attributes of the "test\_service\_/boot" service on host "la-master01":

```
# curl -G --data-urlencode -s --insecure -u monitor:monitor "https://localhost/api/config/service/la-master01;test_service_/boot"
```

This fails:

```
{
  "error": "Invalid request",
  "full_error": "Please visit https://localhost/api/help with a browser to see documentation"
}
```

The solution to this is to not only url-encode the slash once ("**%2F**"), but url-encode the url-encoded string ("**%252F**"). Meaning, instead of passing this URL:

```
https://localhost/api/config/service/la-master01;test_service_/boot
```

Pass this:

```
https://localhost/api/config/service/la-master01;test_service_%252Fboot
```

Response:

```
{
  "host_name": "la-master01",
  "service_description": "test_service_/boot",
  "check_command": "check_dummy",
  "check_command_args": "1",
  "template": "default-service",
  "register": true,
  "file_id": "etc/services.cfg",
  (...)
```


