본문으로 건너뛰기

기기 조회 GET ​

고유 식별자로 특정 기기의 상세 정보를 조회해요.

엔드포인트 ​

GET https://api.pocketalert.app/v1/devices/{tid}

인증 ​

필수

요청에 다음 헤더 중 하나를 포함해 주세요:

  • Token: <your-api-key> — API 키에서 발급받을 수 있어요
  • Authorization: Bearer <jwt-token> — 로그인으로 얻을 수 있어요

요청 ​

경로 파라미터 ​

파라미터타입필수설명
tidstring✅기기 고유 식별자

헤더 ​

헤더필수설명
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

기기 객체를 반환해요

필드타입설명
tidstring기기 고유 식별자
namestring기기 이름
serial_numberstring기기 시리얼 번호
is_activeboolean기기 활성화 여부
created_atstring등록 시각
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찾을 수 없음 — 기기가 존재하지 않음

Pocket Alert 문서