본문으로 건너뛰기

메시지 조회 GET ​

고유 식별자로 특정 메시지의 상세 정보를 조회합니다.

엔드포인트 ​

GET https://api.pocketalert.app/v1/messages/{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/messages/jb4xw9elz24c5" \
  -H "Token: your-api-key"
javascript
const tid = 'jb4xw9elz24c5';
const response = await fetch(`https://api.pocketalert.app/v1/messages/${tid}`, {
  headers: { 'Token': 'your-api-key' }
});
const message = await response.json();
python
import requests

tid = 'jb4xw9elz24c5'
response = requests.get(
    f'https://api.pocketalert.app/v1/messages/{tid}',
    headers={'Token': 'your-api-key'}
)
print(response.json())
php
$tid = 'jb4xw9elz24c5';
$response = Http::withHeaders([
    'Token' => 'your-api-key',
])->get('https://api.pocketalert.app/v1/messages/'.$tid);

return $response->json();

응답 ​

성공 응답 ​

200 OK

메시지 객체를 반환합니다

필드타입설명
tidstring메시지 고유 식별자
titlestring메시지 제목
messagestring메시지 본문
applicationstring애플리케이션 이름
devicestring대상 기기
is_readboolean메시지 읽음 여부
created_atstring생성 시각
json
{
  "tid": "jb4xw9elz24c5",
  "title": "Server Alert",
  "message": "CPU usage exceeded 90%",
  "application": "Monitoring",
  "device": "iPhone",
  "is_read": true,
  "created_at": "18.09.2023 17:35:35"
}

에러 응답 ​

상태설명
401인증 실패 — 토큰이 잘못되었거나 없음
404찾을 수 없음 — 메시지가 존재하지 않음

Pocket Alert 문서