# 모든 기기 조회 (GET)

계정에 등록된 모든 기기 목록을 가져옵니다.

## 엔드포인트

```
GET https://api.pocketalert.app/v1/devices
```

## 인증

> **Info: 필수**
>
> 요청에 다음 헤더 중 하나를 포함하세요:
> - `Token: <your-api-key>` — [API 키](https://pocketalert.app/account/apikeys)에서 발급받으세요
> - `Authorization: Bearer <jwt-token>` — [로그인](https://info.pocketalert.app/api/user/login.md)에서 발급받은 토큰

## 요청

### 헤더

| 헤더 | 필수 | 설명 |
|------|:----:|------|
| `Token` | ✅ | API 키 |
| `Authorization` | ✅ | `Bearer <jwt-token>` |

### 요청 예시

**cURL**

```bash
curl -X GET "https://api.pocketalert.app/v1/devices" \
  -H "Token: your-api-key"
```

**JavaScript**

```javascript
const response = await fetch('https://api.pocketalert.app/v1/devices', {
  headers: { 'Token': 'your-api-key' }
});

const devices = await response.json();
```

**Python**

```python
import requests

response = requests.get(
    'https://api.pocketalert.app/v1/devices',
    headers={'Token': 'your-api-key'}
)
print(response.json())
```

**PHP**

```php
$response = Http::withHeaders([
    'Token' => 'your-api-key',
])->get('https://api.pocketalert.app/v1/devices');

return $response->json();
```

## 응답

### 성공 응답

> **Tip: 200 OK**
>
> 기기 객체의 배열을 반환합니다

| 필드 | 타입 | 설명 |
|------|------|------|
| `tid` | string | 기기의 고유 식별자 |
| `name` | string | 기기 이름 |
| `serial_number` | string | 기기 일련번호 |
| `is_active` | boolean | 기기 활성화 여부 |
| `created_at` | string | 등록 시각 |

```json
[
  {
    "tid": "9dc24hqldvv2bfx2nlc6r",
    "name": "iPhone 15 Pro",
    "serial_number": "123456-OK91-KLAI-8K91-32A0AKSA28X2",
    "is_active": true,
    "created_at": "12.06.2023 02:48:49"
  },
  {
    "tid": "qjxozlq7xr7fakrjplj193",
    "name": "Android Tablet",
    "serial_number": "GP2A.2891092711.017",
    "is_active": true,
    "created_at": "07.06.2023 22:44:47"
  }
]
```

### 오류 응답

| 상태 | 설명 |
|:----:|------|
| `401` | 인증 실패 — 토큰이 잘못되었거나 누락됨 |
