ไม่ต้องเข้าสู่ระบบ · ไม่ต้องใช้คีย์ API
เริ่มต้นใช้งานได้ทันทีโดยไม่ต้องระบุตัวตน
API เดียวกันกับที่ขับเคลื่อนเว็บแอป TempMail ทุกกล่องจดหมายจะได้รับที่อยู่อีเมลแบบสุ่มและมีอายุการใช้งาน 24 ชั่วโมง
- 1POST /accounts เพื่อสร้างกล่องจดหมายพร้อมที่อยู่อีเมลและรหัสผ่านแบบสุ่ม
- 2POST /token เพื่อแลกเปลี่ยนที่อยู่อีเมลและรหัสผ่านเป็นโทเค็นกล่องจดหมาย tm_box_
- 3GET /messages เพื่อรับอีเมลขาเข้าพร้อมรหัสยืนยันที่แยกไว้เรียบร้อยแล้ว
BASE=https://www.tempmail.ai/api/v1
# 1. Create a mailbox (random address + password)
curl -s -X POST "$BASE/accounts" \
-H "Content-Type: application/json" -d '{}'
# {"id":"…","address":"k3x9m2q7…@tempmail.ai","password":"…","expires_at":"…"}
# 2. Exchange the credentials for a mailbox token
curl -s -X POST "$BASE/token" \
-H "Content-Type: application/json" \
-d '{"address":"ADDRESS","password":"PASSWORD"}'
# {"id":"…","token":"tm_box_…","token_type":"Bearer","expires_at":"…"}
# 3. Read messages – verification codes are already extracted
curl -s "$BASE/messages" -H "Authorization: Bearer TOKEN"
# {"items":[{"from":"[email protected]","subject":"Your verification code","verification_code":"482913",…}],"total":1,…}