기기 조회 GET
고유 식별자로 특정 기기의 상세 정보를 조회해요.
엔드포인트
GET https://api.pocketalert.app/v1/devices/{tid}인증
필수
요청에 다음 헤더 중 하나를 포함해 주세요:
요청
경로 파라미터
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
tid | string | ✅ | 기기 고유 식별자 |
헤더
| 헤더 | 필수 | 설명 |
|---|---|---|
Token | ✅ | API 키 |
Authorization | ✅ | Bearer <jwt-token> |
요청 예시
bash
curl -X GET "https://api.pocketalert.app/v1/devices/9dc24hqldvv2bfx2nlc6r" \
-H "Token: your-api-key"javascript
const tid = '9dc24hqldvv2bfx2nlc6r';
const response = await fetch(`https://api.pocketalert.app/v1/devices/${tid}`, {
headers: { 'Token': 'your-api-key' }
});
const device = await response.json();python
import requests
tid = '9dc24hqldvv2bfx2nlc6r'
response = requests.get(
f'https://api.pocketalert.app/v1/devices/{tid}',
headers={'Token': 'your-api-key'}
)
print(response.json())php
$tid = '9dc24hqldvv2bfx2nlc6r';
$response = Http::withHeaders([
'Token' => 'your-api-key',
])->get('https://api.pocketalert.app/v1/devices/'.$tid);
return $response->json();응답
성공 응답
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"
}오류 응답
| 상태 | 설명 |
|---|---|
401 | 인증 실패 — 토큰이 잘못되었거나 누락됨 |
404 | 찾을 수 없음 — 기기가 존재하지 않음 |