본문으로 건너뛰기

메시지 업데이트 PUT ​

기존 메시지의 내용이나 읽음 상태를 업데이트합니다.

엔드포인트 ​

PUT https://api.pocketalert.app/v1/messages/{tid}

인증 ​

필수

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

  • Token: <your-api-key> — API 키에서 발급받을 수 있습니다
  • Authorization: Bearer <jwt-token> — 로그인에서 발급받을 수 있습니다

요청 ​

경로 매개변수 ​

매개변수타입필수설명
tidstring✅메시지 고유 식별자

헤더 ​

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

본문 매개변수 ​

매개변수타입필수설명
titlestring✅메시지 제목
messagestring✅메시지 본문 텍스트
application_idstring❌애플리케이션 TID
device_idstring❌기기 TID
is_readboolean❌읽음/안 읽음 표시

요청 예시 ​

bash
curl -X PUT "https://api.pocketalert.app/v1/messages/jb4xw9elz24c5" \
  -H "Token: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Updated Title",
    "message": "Updated message content",
    "is_read": true
  }'
javascript
const tid = 'jb4xw9elz24c5';
const response = await fetch(`https://api.pocketalert.app/v1/messages/${tid}`, {
  method: 'PUT',
  headers: {
    'Token': 'your-api-key',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    title: 'Updated Title',
    message: 'Updated message content',
    is_read: true
  })
});
python
import requests

tid = 'jb4xw9elz24c5'
response = requests.put(
    f'https://api.pocketalert.app/v1/messages/{tid}',
    headers={'Token': 'your-api-key'},
    json={
        'title': 'Updated Title',
        'message': 'Updated message content',
        'is_read': True
    }
)
print(response.json())
php
$tid = 'jb4xw9elz24c5';
$response = Http::withHeaders([
    'Token' => 'your-api-key',
])->put('https://api.pocketalert.app/v1/messages/'.$tid, [
    'title' => 'Updated Title',
    'message' => 'Updated message content',
    'is_read' => true,
]);

return $response->json();

응답 ​

성공 응답 ​

200 OK

메시지가 성공적으로 업데이트되었습니다

json
{
  "data": "success"
}

오류 응답 ​

상태설명
401인증 실패 — 토큰이 잘못되었거나 없습니다
404찾을 수 없음 — 메시지가 존재하지 않습니다
400잘못된 요청 — 요청 본문이 올바르지 않습니다

Pocket Alert 문서