INTEGRASIKAN EXTYMAIL
KE APLIKASI Anda.
Semua endpoint /v1/* membutuhkan API key yang dibuat administrator. API key dikirim melalui header Authorization.
Authorization: Bearer exty_xxxxxxxxxxxxxxxxx
POST
/v1/inboxes
Membuat inbox lifetime baru.
curl -X POST https://tmail.exty.me/v1/inboxes \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"username":"namalu","domain":"exty.me"}'RESPONSE
{
"id": "inbox_id",
"address": "namalu@exty.me",
"ownerToken": "simpan_token_ini",
"publicUrl": "https://tmail.exty.me/namalu%40exty.me",
"permanent": true
}SCOPE: inbox:createGET
/v1/inboxes/:address/messages
Mengambil daftar email dari inbox.
curl "https://tmail.exty.me/v1/inboxes/namalu%40exty.me/messages" \ -H "Authorization: Bearer YOUR_API_KEY"SCOPE: inbox:read
GET
/v1/inboxes/:address/messages/:messageId
Mengambil detail isi email dan daftar attachment.
curl "https://tmail.exty.me/v1/inboxes/namalu%40exty.me/messages/MESSAGE_ID" \ -H "Authorization: Bearer YOUR_API_KEY"SCOPE: message:read
GET
/v1/inboxes/:address/link
Mengambil public URL inbox untuk disalin atau dibagikan.
curl "https://tmail.exty.me/v1/inboxes/namalu%40exty.me/link" \ -H "Authorization: Bearer YOUR_API_KEY"SCOPE: inbox:link
DELETE
/v1/inboxes/:inboxId
Menghapus inbox. Wajib memakai owner token yang diterima saat generate inbox.
curl -X DELETE "https://tmail.exty.me/v1/inboxes/INBOX_ID" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "X-Inbox-Owner-Token: OWNER_TOKEN"SCOPE: inbox:delete
JAVASCRIPT EXAMPLE
const response = await fetch("https://tmail.exty.me/v1/inboxes", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
username: "namalu",
domain: "exty.me"
})
});
const inbox = await response.json();
console.log(inbox.publicUrl);