List inventory devices
curl --request GET \
--url https://api.example.com/api/v1/inventory/devices/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/inventory/devices/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/inventory/devices/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/inventory/devices/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/inventory/devices/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/inventory/devices/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/inventory/devices/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"count": 123,
"results": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"netbox_id": 123,
"position": 123,
"serial_number": "<string>",
"bmc_ip": "<string>",
"asset_tag": "<string>",
"description": "<string>",
"primary_ip": "<string>",
"custom_fields": {},
"device_type": {
"manufacturer": "<string>",
"model": "<string>",
"kind": "COMPUTE",
"part_number": "<string>",
"u_height": 123
},
"role": {
"name": "<string>",
"slug": "<string>"
},
"rack": {
"name": "<string>",
"location": "<string>",
"serial_number": "<string>"
},
"location": {
"name": "<string>",
"description": "<string>",
"ancestors": [
{
"name": "<string>",
"slug": "<string>",
"description": "<string>"
}
]
},
"site": {
"name": "<string>",
"slug": "<string>",
"netbox_id": 123,
"datacenter": "<string>",
"description": "<string>",
"region": "<string>",
"syslog_server": "<string>"
},
"status": "planned",
"interfaces": [
{
"name": "<string>",
"type": "<string>",
"mac_address": "<string>",
"ip_addresses": [
"<string>"
],
"ib_device_guid": "<string>",
"speed": 123,
"enabled": true
}
],
"fru": [
{
"category": "cpu",
"serial_number": "<string>",
"part_number": "<string>",
"model_number": "<string>"
}
],
"switch_port": "<string>",
"source_updated_at": "2023-11-07T05:31:56Z",
"last_synced_at": "2023-11-07T05:31:56Z"
}
],
"next": "http://api.example.org/accounts/?page=4",
"previous": "http://api.example.org/accounts/?page=2"
}{
"detail": "<string>",
"code": "error",
"field_errors": [
{
"field": "<string>",
"messages": [
"<string>"
]
}
]
}{
"detail": "<string>",
"code": "error",
"field_errors": [
{
"field": "<string>",
"messages": [
"<string>"
]
}
]
}{
"detail": "<string>",
"code": "error",
"field_errors": [
{
"field": "<string>",
"messages": [
"<string>"
]
}
]
}Inventory
List inventory devices
Read-only customer inventory projection endpoint.
GET
/
api
/
v1
/
inventory
/
devices
/
List inventory devices
curl --request GET \
--url https://api.example.com/api/v1/inventory/devices/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/inventory/devices/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/inventory/devices/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/inventory/devices/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/inventory/devices/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/inventory/devices/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/inventory/devices/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"count": 123,
"results": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"netbox_id": 123,
"position": 123,
"serial_number": "<string>",
"bmc_ip": "<string>",
"asset_tag": "<string>",
"description": "<string>",
"primary_ip": "<string>",
"custom_fields": {},
"device_type": {
"manufacturer": "<string>",
"model": "<string>",
"kind": "COMPUTE",
"part_number": "<string>",
"u_height": 123
},
"role": {
"name": "<string>",
"slug": "<string>"
},
"rack": {
"name": "<string>",
"location": "<string>",
"serial_number": "<string>"
},
"location": {
"name": "<string>",
"description": "<string>",
"ancestors": [
{
"name": "<string>",
"slug": "<string>",
"description": "<string>"
}
]
},
"site": {
"name": "<string>",
"slug": "<string>",
"netbox_id": 123,
"datacenter": "<string>",
"description": "<string>",
"region": "<string>",
"syslog_server": "<string>"
},
"status": "planned",
"interfaces": [
{
"name": "<string>",
"type": "<string>",
"mac_address": "<string>",
"ip_addresses": [
"<string>"
],
"ib_device_guid": "<string>",
"speed": 123,
"enabled": true
}
],
"fru": [
{
"category": "cpu",
"serial_number": "<string>",
"part_number": "<string>",
"model_number": "<string>"
}
],
"switch_port": "<string>",
"source_updated_at": "2023-11-07T05:31:56Z",
"last_synced_at": "2023-11-07T05:31:56Z"
}
],
"next": "http://api.example.org/accounts/?page=4",
"previous": "http://api.example.org/accounts/?page=2"
}{
"detail": "<string>",
"code": "error",
"field_errors": [
{
"field": "<string>",
"messages": [
"<string>"
]
}
]
}{
"detail": "<string>",
"code": "error",
"field_errors": [
{
"field": "<string>",
"messages": [
"<string>"
]
}
]
}{
"detail": "<string>",
"code": "error",
"field_errors": [
{
"field": "<string>",
"messages": [
"<string>"
]
}
]
}Authorizations
oauth2cookieAuth
The access token received from the authorization server in the OAuth 2.0 flow.
Query Parameters
Number of results to return per page.
Required range:
1 <= x <= 500A page number within the paginated result set.
Fleet Manager site ID used to filter inventory devices.