# API improvements

**URL:** <https://community.info-beamer.com/t/api-improvements/879>\
**Category:** Announcements\
**Created:** [May 5, 2020, 11:07am UTC](https://community.info-beamer.com/t/api-improvements/879 "2020-05-05T11:07:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![infobeamer-fw](https://community.info-beamer.com/user_avatar/community.info-beamer.com/infobeamer-fw/32/3_2.png) [@infobeamer-fw](https://community.info-beamer.com/u/infobeamer-fw)\
**Post date:** [May 5, 2020, 11:07am UTC](https://community.info-beamer.com/t/api-improvements/879/1 "2020-05-05T11:07:36Z")

</div>

Development never stops 🙂

Yesterday a new release of the website/backend has been released and it adds the following improvements:

## Package/Asset API speedup

The API calls for [listing packages](https://info-beamer.com/doc/api#listallpackages) and [listing assets](https://info-beamer.com/doc/api#listallassets) have been improved and they should now be twice as fast. This might make a difference if you have a large number of assets or packages in your account. The package improvement reduced some load to the database by intelligent caching of often accessed package information like [package information](https://info-beamer.com/doc/package-reference#packagejson) and their node [configuration options](https://info-beamer.com/doc/package-reference#nodeconfiguration). You can see the difference to the database load in the graph from the monitoring system:

 ![image](https://community.info-beamer.com/uploads/default/original/1X/58d7a6c619d024c3480e003a293e546b233ccc62.png)

## API call list filters

Previously only the [device check API call](https://info-beamer.com/doc/api#devicescheck) supported filters. Now this has been extended to other API calls. This feature is still undocumented at the moment. Until that’s done, here’s a small preview of what’s possible now (all query strings unquoted to make them more readable. Use a library to construct them in a real world use case!):

- Filtering device list by device location:

- Filtering by other properties:

- Filter by nested information:

- Filter by userdata:

Right now the [device list](https://info-beamer.com/doc/api#listalldevices), [setup list](https://info-beamer.com/doc/api#listallsetups) and [asset list](https://info-beamer.com/doc/api#listallassets) calls have support for filtering. Note that not all properties can be filtered. Official documentation will follow. Feedback welcome.

---

<div class="post-metadata">

**Author:** ![matthias.haehnel](https://community.info-beamer.com/user_avatar/community.info-beamer.com/matthias.haehnel/32/398_2.png) [@matthias.haehnel](https://community.info-beamer.com/u/matthias.haehnel)\
**Post date:** [May 13, 2020, 9:47am UTC](https://community.info-beamer.com/t/api-improvements/879/2 "2020-05-13T09:47:19Z")

</div>

Looks like we requests that are urlencoded wont be answerd…

```
curl -u ":XXX" "https://info-beamer.com/api/v1/device/list?filter%3Alocation%3DHQ"
{"error":"Cannot list devices: Cannot filter by location=HQ"}

```

can you enable this too?

---

<div class="post-metadata">

**Author:** ![infobeamer-fw](https://community.info-beamer.com/user_avatar/community.info-beamer.com/infobeamer-fw/32/3_2.png) [@infobeamer-fw](https://community.info-beamer.com/u/infobeamer-fw)\
**Post date:** [May 13, 2020, 10:14am UTC](https://community.info-beamer.com/t/api-improvements/879/3 "2020-05-13T10:14:50Z")

</div>

> [@matthias.haehnel](#):
>
> filter%3Alocation%3DHQ

That quoted the name/value separator `=`. The name in the case is `filter%3Alocation`, which is the correctly quoted value `filter:location`. The value is `HQ` and doesn’t need quoting in that case. The combined correct parameter is therefore `filter%3Alocation=HQ`. The `=` must not be quoted itself, otherwise it becomes part of the name/value rather than being a separator. Are you using a library to construct the query url?

---

<div class="post-metadata">

**Author:** ![matthias.haehnel](https://community.info-beamer.com/user_avatar/community.info-beamer.com/matthias.haehnel/32/398_2.png) [@matthias.haehnel](https://community.info-beamer.com/u/matthias.haehnel)\
**Post date:** [May 13, 2020, 12:20pm UTC](https://community.info-beamer.com/t/api-improvements/879/4 "2020-05-13T12:20:09Z")

</div>

thx, with this information i was able to create a workaround.  
i do indeed use a library ([Flexirest](https://github.com/flexirest/flexirest)) which uses `:` in the query as an indicator for variable substitution.

i now explict use the urlencoded `:` (`%3A`) in the request builder:  
`get :list_filtered, '/device/list?filter%3A:filter=:location', ignore_root: 'devices'`

---

<div class="post-metadata">

**Author:** ![infobeamer-fw](https://community.info-beamer.com/user_avatar/community.info-beamer.com/infobeamer-fw/32/3_2.png) [@infobeamer-fw](https://community.info-beamer.com/u/infobeamer-fw)\
**Post date:** [May 13, 2020, 12:28pm UTC](https://community.info-beamer.com/t/api-improvements/879/5 "2020-05-13T12:28:17Z")

</div>

> [@matthias.haehnel](#):
>
> […] uses `:` in the query as an indicator

Interesting. Didn’t expect that. Good to know that the workaround is rather trivial.
