> For the complete documentation index, see [llms.txt](https://docs.developer.disruptive-technologies.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.developer.disruptive-technologies.com/explore-our-rest-api/with-postman.md).

# with Postman

## Overview

We will here show how Postman can be used to interact with our REST API. As an example, Basic Auth will be used to authenticate a GET request that fetches a list of available projects and a POST request that creates a new label for a device. All available endpoints are listed in our [REST API Reference](https://developer.disruptive-technologies.com/api).

## Prerequisites

* **Enable Basic Auth**\
  You need to have [created a Service Account](/service-accounts/creating-a-service-account.md) with Basic Auth and a role of Project Developer or higher.

## Postman

Postman is a collaboration platform for API development. It is a powerful tool with many useful features, but we will here use it to make simple arbitrary HTTP requests.

### Installation

Postman can be acquired from the official [downloads page](https://www.postman.com/downloads/).

### Authorization

When creating a new request, under the **Authorization** tab, specify the method of Basic Auth.

* **Username:** Your Service Account Key ID.
* **Password:** Your Service Account Secret.

![](/files/-MTaLVnvrtZqiJe0rC7s)

## GET Request

To fetch a list of all projects available to a Service Account, create a new GET request with the following endpoint URL. No request body is required for this call.

`https://api.d21s.com/v2/projects`

![](/files/-MTaSkp7jNUND1UcApb7)

If the valid key-id and secret of a Service Account with sufficient privileges were used, Postman should return a list of the available project for that account.

```javascript
{
    "projects": [
        {
            "name": "projects/<PROJECT_ID>",
            "displayName": "wCaV7Y",
            "organization": "organizations/<ORGANIZATION_ID>",
            "organizationDisplayName": "Disruptive Technologies Research",
            "sensorCount": 10,
            "cloudConnectorCount": 1,
            "inventory": false
        }
    ],
    "nextPageToken": ""
}
```

## POST Request

To add a new label to a device, create a new POST request with the following endpoint URL.

`https://api.d21s.com/v2/projects/<PROJECT_ID>/devices/<DEVICE_ID>/labels`

For the body, choose Raw and then JSON. Within, the label name and value should be provided.

![](/files/-MTaSKgKTAU2y2UmADNs)

If the valid key-id and secret of a Service Account with sufficient privileges were used, Postman should return the name, key, and value.

```javascript
{
    "name": "projects/<PROJECT_ID>/devices/<DEVICE_ID>/labels/my-new-label",
    "key": "my-new-label",
    "value": "some-value"
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.developer.disruptive-technologies.com/explore-our-rest-api/with-postman.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
