---
title: "API Response Dataset Filtering"
canonical: "https://docs.vaultspeed.com/space/VPD/3400893563/API%20Response%20Dataset%20Filtering"
format: markdown
---
Some API endpoints have custom filtering enabled for returned datasets that list items. While filtering by a single attribute is quite straightforward, additional logic applies when building filters that use more than one attribute.

## Filter by a Single Attribute

Follow the [querying data guide](https://loopback.io/doc/en/lb4/Querying-data.html) from LoopBack documentation.

```plaintext
/api/data-vault/releases?filter[where][dv_name]=SOME_NAME_HERE
```

## Filter by Multiple Attributes

Follow [filtering rules for and/or operators](https://loopback.io/doc/en/lb4/Where-filter.html#and--or) from LoopBack framework documentation.

```plaintext
/api/data-vault/releases?filter[where][and][0][dv_name]=SOME_NAME_HERE&filter[where][and][1][vs_dv_name]=SOME_OTHER_NAME_HERE
```

For the `AND` operator to work when using two attributes, you need to pass the `filter` parameter two times (or as many as there are attributes), and in each instance tell it participates in the `WHERE` condition with the `AND` operator (`[where][and]`) along with enumerator (`[0]` and `[1]` respectively) preceding the attribute name. Basically, the filtering part in a URL consists of two parts in this case:

- `filter[where][and][0][dv_name]=SOME_NAME_HERE`
- `filter[where][and][1][vs_dv_name]=SOME_OTHER_NAME_HERE`

In the URL, these two parts are joined together with an ampersand (`&`).

## URL Encode Parameters

Keep in mind that when strings are used in a URL, values must be [URL-encode](https://www.w3schools.com/tags/ref_urlencode.ASP)d: a space becomes `%20,` and so on.

## Client Limitations

Based on [RFC 1738](https://www.ietf.org/rfc/rfc1738.txt), symbols `[` and `]` are considered unsafe in URLs:

> Other characters are unsafe because gateways and other transport agents are known to sometimes modify such characters. These characters are "{", "}", "|", "\", "^", "~", "[", "]", and "`".

Therefore clients that query the API may be strict in following mentioned RFC. For example, to use `curl` with the filter syntax mentioned above, it is required [to pass an additional parameter](https://curl.se/docs/manpage.html#-g) `--globoff`.