# Box
A Firewalla box represents a physical Firewalla device.

## Get Boxes
[!badge variant="primary" text="GET"] <span style="color:grey">https://msp_domain</span>**/v2/boxes**

<p class="parameters">Parameters</p>
<p class="header">Header</p>

| Name                                          | Value                 |
| --------------------------------------------- | --------------------- |
| Authorization <span style="color:orange">*required*</span> | Personal access token |

<p class="header">Query String</p>

| Name  | Value
| ----- | ---
| group | Gets boxes within a specific group, must be supplied with the ID of a box group

<p class="response">Response</p>

<p class="statusCode"><svg class="green" viewBox="0 0 8 16" preserveAspectRatio="xMidYMid meet"><path d="M0 8c0-2.2 1.8-4 4-4s4 1.8 4 4-1.8 4-4 4-4-1.8-4-4z" fill="currentColor" fill-rule="evenodd"></path></svg>
<span>200 Success</span>

</p>

A JSON array of [Boxes](../data-models/box.md/#box)

```json
[
  {
    "gid": "00000000-0000-0000-0000-000000000000",
    "model": "gold",
    "name": "My Firewalla",
    "mode": "router",
    "online": true,
    "version": "1.975",
    "license": "00000000-1111-1111-1111-000000000000",
    "publicIP": "1.1.1.1",
    "location": "Los Angeles, US",
    "lastSeen": 1648632679.193,
    "group": null,
    "deviceCount": 11,
    "ruleCount": 34,
    "alarmCount": 89
  }
]
```

<p class="statusCode">
<svg viewBox="0 0 8 16" preserveAspectRatio="xMidYMid meet" class="brown"><path d="M0 8c0-2.2 1.8-4 4-4s4 1.8 4 4-1.8 4-4 4-4-1.8-4-4z" fill="currentColor" fill-rule="evenodd"></path></svg>
<span>401 Permission Denied</span>
</p>

<p class="examples">Examples</p>

+++ Node.js
```js
// https://github.com/axios/axios
const axios = require("axios");

// Change these variables to what you have
const msp_domain = process.env.msp_domain || "mydomain.firewalla.net";
const token = process.env.token || "your_personal_access_token";

axios({
    method: 'get',
    url: `https://${msp_domain}/v2/boxes`,
    headers: {
        Authorization: `Token ${token}`
    }
}).then(res => {
    console.log(res.data);
})
```
+++ cURL
```bash
curl --request GET  \
--url "https://${msp_domain}/v2/boxes" \
--header "Authorization: Token ${your_personal_access_token}"

# Get box info by box name
curl --request GET  \
--url "https://${msp_domain}/v2/boxes" \
--header "Authorization: Token ${your_personal_access_token}" | jq '.[] | select(.name=="Gold")'
```
+++
