Skip to content

Vendors

Manage vendors in your Smart Inventory.


List vendors

GET /external/smart-inventory/vendor/list

Returns all vendors for your company.

curl -X GET https://nightly.api.trustview.eu/external/smart-inventory/vendor/list \
  -H "X-API-Key: tvw_sk_live_your_key_here"
const res = await fetch(
  "https://nightly.api.trustview.eu/external/smart-inventory/vendor/list",
  {
    headers: { "X-API-Key": "tvw_sk_live_your_key_here" },
  }
);
const vendors = await res.json();
$ch = curl_init('https://nightly.api.trustview.eu/external/smart-inventory/vendor/list');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-API-Key: tvw_sk_live_your_key_here']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = json_decode(curl_exec($ch));
curl_close($ch);
import requests

response = requests.get(
    "https://nightly.api.trustview.eu/external/smart-inventory/vendor/list",
    headers={"X-API-Key": "tvw_sk_live_your_key_here"},
)
vendors = response.json()

Response

[
  {
    "uniqueId": "6a054b8b9ae1a",
    "name": "Acme Cloud Services",
    "status": "active"
  }
]

Create a vendor

POST /external/smart-inventory/vendor/new

Creates a new vendor.

curl -X POST https://nightly.api.trustview.eu/external/smart-inventory/vendor/new \
  -H "X-API-Key: tvw_sk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"name": "Acme Cloud Services", "description": "<p>Primary cloud vendor</p>", "active": true}'
const res = await fetch(
  "https://nightly.api.trustview.eu/external/smart-inventory/vendor/new",
  {
    method: "POST",
    headers: {
      "X-API-Key": "tvw_sk_live_your_key_here",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      name: "Acme Cloud Services",
      description: "<p>Primary cloud vendor</p>",
      active: true,
    }),
  }
);
const vendor = await res.json();
$ch = curl_init('https://nightly.api.trustview.eu/external/smart-inventory/vendor/new');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'X-API-Key: tvw_sk_live_your_key_here',
    'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
    'name' => 'Acme Cloud Services',
    'description' => '<p>Primary cloud vendor</p>',
    'active' => true,
]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = json_decode(curl_exec($ch));
curl_close($ch);
import requests

response = requests.post(
    "https://nightly.api.trustview.eu/external/smart-inventory/vendor/new",
    headers={"X-API-Key": "tvw_sk_live_your_key_here"},
    json={
        "name": "Acme Cloud Services",
        "description": "<p>Primary cloud vendor</p>",
        "active": True,
    },
)
vendor = response.json()

Response

Returns the created vendor object.


Get a vendor

GET /external/smart-inventory/vendor/{vendor}/item

Retrieves a single vendor by its unique ID.

Name In Type Description
vendor path string Enter vendor's unique ID

Tip

The vendor's unique ID can be found in the address bar when viewing a vendor.

curl -X GET https://nightly.api.trustview.eu/external/smart-inventory/vendor/6a054b8b9ae1a/item \
  -H "X-API-Key: tvw_sk_live_your_key_here"
const res = await fetch(
  "https://nightly.api.trustview.eu/external/smart-inventory/vendor/6a054b8b9ae1a/item",
  {
    headers: { "X-API-Key": "tvw_sk_live_your_key_here" },
  }
);
const vendor = await res.json();
$ch = curl_init('https://nightly.api.trustview.eu/external/smart-inventory/vendor/6a054b8b9ae1a/item');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-API-Key: tvw_sk_live_your_key_here']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = json_decode(curl_exec($ch));
curl_close($ch);
import requests

response = requests.get(
    "https://nightly.api.trustview.eu/external/smart-inventory/vendor/6a054b8b9ae1a/item",
    headers={"X-API-Key": "tvw_sk_live_your_key_here"},
)
vendor = response.json()

Update a vendor

PATCH /external/smart-inventory/vendor/{vendor}/edit

Updates an existing vendor. Send only the fields you want to change.

Name In Type Description
vendor path string Enter vendor's unique ID

Tip

The vendor's unique ID can be found in the address bar when viewing a vendor.

curl -X PATCH https://nightly.api.trustview.eu/external/smart-inventory/vendor/6a054b8b9ae1a/edit \
  -H "X-API-Key: tvw_sk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"name": "Acme Cloud Services (updated)"}'
const res = await fetch(
  "https://nightly.api.trustview.eu/external/smart-inventory/vendor/6a054b8b9ae1a/edit",
  {
    method: "PATCH",
    headers: {
      "X-API-Key": "tvw_sk_live_your_key_here",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ name: "Acme Cloud Services (updated)" }),
  }
);
$ch = curl_init('https://nightly.api.trustview.eu/external/smart-inventory/vendor/6a054b8b9ae1a/edit');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'X-API-Key: tvw_sk_live_your_key_here',
    'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['name' => 'Acme Cloud Services (updated)']));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);
import requests

response = requests.patch(
    "https://nightly.api.trustview.eu/external/smart-inventory/vendor/6a054b8b9ae1a/edit",
    headers={"X-API-Key": "tvw_sk_live_your_key_here"},
    json={"name": "Acme Cloud Services (updated)"},
)

Response

Returns 204 No Content on success.


Delete a vendor

DELETE /external/smart-inventory/vendor/{vendor}/delete

Removes a vendor.

Name In Type Description
vendor path string Enter vendor's unique ID

Tip

The vendor's unique ID can be found in the address bar when viewing a vendor.

curl -X DELETE https://nightly.api.trustview.eu/external/smart-inventory/vendor/6a054b8b9ae1a/delete \
  -H "X-API-Key: tvw_sk_live_your_key_here"
const res = await fetch(
  "https://nightly.api.trustview.eu/external/smart-inventory/vendor/6a054b8b9ae1a/delete",
  {
    method: "DELETE",
    headers: { "X-API-Key": "tvw_sk_live_your_key_here" },
  }
);
$ch = curl_init('https://nightly.api.trustview.eu/external/smart-inventory/vendor/6a054b8b9ae1a/delete');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-API-Key: tvw_sk_live_your_key_here']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);
import requests

response = requests.delete(
    "https://nightly.api.trustview.eu/external/smart-inventory/vendor/6a054b8b9ae1a/delete",
    headers={"X-API-Key": "tvw_sk_live_your_key_here"},
)

Response

Returns 204 No Content on success.