Assets
List assets (paged, filterable)
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| search | query | string | |
| page | query | integer | |
| limit | query | integer | |
| type | query | string | |
| client_id | query | integer |
Example request
curl "https://YOUR-HOST/api/v1/assets" \
-H "Authorization: Bearer $TOKEN"
import requests
response = requests.get(
"https://YOUR-HOST/api/v1/assets",
headers={"Authorization": f"Bearer {TOKEN}"},
)
print(response.json())
const response = await fetch("https://YOUR-HOST/api/v1/assets", {
method: "GET",
headers: { "Authorization": `Bearer ${TOKEN}` },
});
const data = await response.json();
$ch = curl_init("https://YOUR-HOST/api/v1/assets");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => ["Authorization: Bearer $token"],
]);
$data = json_decode(curl_exec($ch), true);
Responses
200Paged asset list
| Field | Type | Description |
|---|---|---|
| data | array of object | |
| data[].id | integer | |
| data[].name | string | |
| data[].type | string | |
| data[].make | string | |
| data[].model | string | |
| data[].serial | string | |
| data[].os | string | |
| data[].status | string | |
| data[].client | string | |
| total | integer |
Example response
json
{
"data": [
{
"id": 1,
"name": "string",
"type": "string",
"make": "string",
"model": "string",
"serial": "string",
"os": "string",
"status": "string",
"client": "string"
}
],
"total": 1
}
Distinct asset types in use (bare string array)
Example request
curl "https://YOUR-HOST/api/v1/assets/types" \
-H "Authorization: Bearer $TOKEN"
import requests
response = requests.get(
"https://YOUR-HOST/api/v1/assets/types",
headers={"Authorization": f"Bearer {TOKEN}"},
)
print(response.json())
const response = await fetch("https://YOUR-HOST/api/v1/assets/types", {
method: "GET",
headers: { "Authorization": `Bearer ${TOKEN}` },
});
const data = await response.json();
$ch = curl_init("https://YOUR-HOST/api/v1/assets/types");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => ["Authorization: Bearer $token"],
]);
$data = json_decode(curl_exec($ch), true);
Responses
200Asset type names
Example response
json
[
"string"
]
Asset detail
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| idrequired | path | integer |
Example request
curl "https://YOUR-HOST/api/v1/assets/1" \
-H "Authorization: Bearer $TOKEN"
import requests
response = requests.get(
"https://YOUR-HOST/api/v1/assets/1",
headers={"Authorization": f"Bearer {TOKEN}"},
)
print(response.json())
const response = await fetch("https://YOUR-HOST/api/v1/assets/1", {
method: "GET",
headers: { "Authorization": `Bearer ${TOKEN}` },
});
const data = await response.json();
$ch = curl_init("https://YOUR-HOST/api/v1/assets/1");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => ["Authorization: Bearer $token"],
]);
$data = json_decode(curl_exec($ch), true);
Responses
200Asset detail
| Field | Type | Description |
|---|---|---|
| id | integer | |
| name | string | |
| type | string | |
| make | string | |
| model | string | |
| serial | string | |
| os | string | |
| status | string | |
| description | string | |
| physical_location | string | |
| location_name | string | |
| location_city | string | |
| location_state | string | |
| contact_name | string | |
| contact_phone | string | |
| client | string | |
| created_at | string | |
| purchase_date | string | |
| warranty_expire | string | |
| notes | string |
Example response
json
{
"id": 1,
"name": "string",
"type": "string",
"make": "string",
"model": "string",
"serial": "string",
"os": "string",
"status": "string",
"description": "string",
"physical_location": "string",
"location_name": "string",
"location_city": "string",
"location_state": "string",
"contact_name": "string",
"contact_phone": "string",
"client": "string",
"created_at": "string",
"purchase_date": "string",
"warranty_expire": "string",
"notes": "string"
}
404Resource not found
| Field | Type | Description |
|---|---|---|
| error | string |