コンテンツへスキップ

メッセージを更新 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認証エラー — トークンが無効または未指定です
404Not Found — メッセージが存在しません
400Bad Request — リクエストボディが不正です

Pocket Alert ドキュメント