> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pads4.com/llms.txt
> Use this file to discover all available pages before exploring further.

# NDS.Services.Sensor

## Overview

Manages sensor inputs and triggers for interactive PADS4 content. Supports motion sensors, RFID readers, QR scanners, and custom input devices that trigger content changes or interactive flows.

| Field           | Value                                                                   |
| --------------- | ----------------------------------------------------------------------- |
| Swagger UI      | `https://<your-server>/rdx/NDS.Services.Sensor/swagger/index.html`      |
| OpenAPI spec    | `https://<your-server>/rdx/NDS.Services.Sensor/swagger/v1/swagger.json` |
| Base URL        | `https://<your-server>/rdx/NDS.Services.Sensor`                         |
| Total endpoints | 31                                                                      |

***

## Authentication

All endpoints use the standard PADS4 session cookie. Obtain it once and reuse:

```bash theme={null}
# Log in and save the session cookie
curl -c cookies.txt -X POST 'https://<your-server>/api/v1/Account/Logon' \
  -H 'Content-Type: application/json' \
  -d '{"UserName": "admin", "Password": "yourpassword", "Domain": "yourdomain"}'

# Use the cookie on all subsequent requests
curl -b cookies.txt -X GET 'https://<your-server>/rdx/<ServiceName>/...'
```

> Replace `https://<your-server>` with your PADS4 server address and `<ServiceName>` with the service path shown above.

***

## Endpoint Reference

| Method   | Path                                          | Description                   |
| -------- | --------------------------------------------- | ----------------------------- |
| `GET`    | `/api/v1/area`                                | Get Areas                     |
| `POST`   | `/api/v1/area`                                | Store Area                    |
| `DELETE` | `/api/v1/area`                                | Delete Area                   |
| `GET`    | `/api/v1/area/rules`                          | Get Supported Rules           |
| `GET`    | `/api/v1/device`                              | Get Devices                   |
| `POST`   | `/api/v1/device`                              | Store Device                  |
| `DELETE` | `/api/v1/device`                              | Delete Device                 |
| `GET`    | `/api/v1/device/types`                        | Get Device Types              |
| `GET`    | `/api/v1/device/stats`                        | Get Device Stats              |
| `GET`    | `/api/v1/device/authTypes`                    | Get Auth Types                |
| `GET`    | `/api/v1/events`                              | Get Events                    |
| `POST`   | `/api/v1/image`                               | Get Image P O S T             |
| `GET`    | `/api/v1/image`                               | Get Image G E T               |
| `POST`   | `/api/v1/incident`                            | Get Incidents                 |
| `POST`   | `/api/v1/incident/status`                     | Update Incident Status        |
| `POST`   | `/api/v1/incident/statistics`                 | Get Incident Stats            |
| `POST`   | `/api/v1/incident/resolutionStatistics`       | Get Incident Resolution Stats |
| `GET`    | `/api/v1/diagnostics/toggles`                 | Get Toggles                   |
| `GET`    | `/api/v1/diagnostics/configuration`           | Get Config Section            |
| `GET`    | `/api/v1/diagnostics/configurationex`         | Get Configuration             |
| `GET`    | `/api/v1/diagnostics/circuitbreakers`         | Get Circuit Breakers          |
| `GET`    | `/api/v1/diagnostics/circuitbreakers/reset`   | Reset Circuit Breaker         |
| `GET`    | `/api/v1/diagnostics/circuitbreakers/isolate` | Isolate Circuit Breaker       |
| `POST`   | `/api/v1/diagnostics/events`                  | Get Events                    |
| `GET`    | `/api/v1/health`                              | Get                           |
| `GET`    | `/api/v1/health/clean`                        | Get Clean                     |
| `POST`   | `/api/v1/Management/RequeueErrorMessages`     | Requeue Error Messages        |
| `POST`   | `/api/v1/Management/PurgeErrorMessages`       | Purge Error Messages          |
| `GET`    | `/migration`                                  | Get Migrations                |
| `POST`   | `/migration`                                  | Execute Migration             |
| `GET`    | `/version`                                    | Get                           |

***

## Request & Response Examples

### GET `/api/v1/area`

**Request:**

```bash theme={null}
curl -b cookies.txt -X GET 'https://<your-server>/rdx/NDS.Services.Sensor/api/v1/area'
```

**Response `200 OK`:**

```json theme={null}
{"Code": "OK", "Succeeded": true}
```

***

### POST `/api/v1/area`

**Request:**

```bash theme={null}
curl -b cookies.txt -X POST 'https://<your-server>/rdx/NDS.Services.Sensor/api/v1/area' \
  -H 'Content-Type: application/json' \
  -d '{"PageIndex": 0, "PageSize": 20}'
```

**Response `200 OK`:**

```json theme={null}
{"Items": [], "TotalCount": 0, "PageIndex": 0, "PageSize": 20, "Code": "OK", "Succeeded": true}
```

***

### DELETE `/api/v1/area`

**Request:**

```bash theme={null}
curl -b cookies.txt -X DELETE 'https://<your-server>/rdx/NDS.Services.Sensor/api/v1/area'
```

**Response `200 OK`:**

```json theme={null}
{"Code": "OK", "Succeeded": true, "Message": null}
```

***

### GET `/api/v1/area/rules`

**Request:**

```bash theme={null}
curl -b cookies.txt -X GET 'https://<your-server>/rdx/NDS.Services.Sensor/api/v1/area/rules'
```

**Response `200 OK`:**

```json theme={null}
{"Code": "OK", "Succeeded": true}
```

***

### GET `/api/v1/device`

**Request:**

```bash theme={null}
curl -b cookies.txt -X GET 'https://<your-server>/rdx/NDS.Services.Sensor/api/v1/device'
```

**Response `200 OK`:**

```json theme={null}
{"Code": "OK", "Succeeded": true}
```

***

### POST `/api/v1/device`

**Request:**

```bash theme={null}
curl -b cookies.txt -X POST 'https://<your-server>/rdx/NDS.Services.Sensor/api/v1/device' \
  -H 'Content-Type: application/json' \
  -d '{"PageIndex": 0, "PageSize": 20}'
```

**Response `200 OK`:**

```json theme={null}
{"Items": [], "TotalCount": 0, "PageIndex": 0, "PageSize": 20, "Code": "OK", "Succeeded": true}
```

***

> Additional endpoints follow the same patterns shown above. See the Swagger UI for full parameter schemas.
