Langsung ke konten

Update Message PUT ​

Perbarui konten atau status baca sebuah pesan.

Endpoint ​

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

Autentikasi ​

Wajib

Sertakan salah satu header berikut dalam permintaan Anda:

  • Token: <your-api-key> — Dapatkan dari Kunci API
  • Authorization: Bearer <jwt-token> — Dari Masuk

Permintaan ​

Path Parameters ​

ParameterTypeRequiredDescription
tidstring✅Pengenal unik pesan

Headers ​

HeaderRequiredDescription
Token✅Kunci API Anda
Authorization✅Bearer <jwt-token>

Body Parameters ​

ParameterTypeRequiredDescription
titlestring✅Judul pesan
messagestring✅Isi teks pesan
application_idstring❌TID aplikasi
device_idstring❌TID perangkat
is_readboolean❌Tandai sudah/belum dibaca

Contoh Permintaan ​

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();

Respons ​

Respons Sukses ​

200 OK

Pesan berhasil diperbarui

json
{
  "data": "success"
}

Respons Error ​

StatusDescription
401Unauthorized — Token tidak valid atau tidak ada
404Not Found — Pesan tidak ditemukan
400Bad Request — isi permintaan tidak valid

Dokumentasi Pocket Alert