OTP One-shot
Gửi email(+pass) + rule_key → server tự chờ và trả OTP trong 1 lần gọi.
1 request
timeout
email+password
Document API
Hướng dẫn tích hợp mua Email / lấy OTP / mua Social.
1. Khi nào dùng
- Tool muốn đơn giản: gọi 1 phát ra OTP.
- Không muốn tự loop poll ở phía client.
Multi-app: Refresh token có thể thuộc app khác (B/C/D) miễn mailbox lưu đúng
Lưu ý: One-shot giữ kết nối HTTP mở tới khi có OTP hoặc timeout.
tenant + client_id (và client_secret nếu là confidential client).Lưu ý: One-shot giữ kết nối HTTP mở tới khi có OTP hoặc timeout.
2. Mapping email → mailbox_id (tuỳ chọn)
POST
/system/api_otp_by_mail.php| Tên | Kiểu | Mô tả |
|---|---|---|
email required | string | Email cần map trong hệ thống. |
password | string | Mật khẩu email (nếu hệ thống có check). |
rule_key | string | Gợi ý rule để log (optional). |
POST https://minisoftwares.net/system/api_otp_by_mail.php
Header: X-API-KEY: YOUR_API_KEY
Body:
{
"email": "testmail01@outlook.com",
"password": "123456",
"rule_key": "tiktok"
}Response mẫu
{
"ok": true,
"mailbox_id": 12,
"email": "testmail01@outlook.com",
"message": "Use mailbox_id with api_otp_request.php + api_otp_poll.php"
}3. One-shot OTP
POST
/system/api_otp_by_mail_oneshot.php| Tên | Kiểu | Mô tả |
|---|---|---|
email required | string | Email cần lấy OTP. |
password | string | Mật khẩu email (nếu hệ thống có check). |
rule_key required | string | Rule lọc OTP (vd tiktok, facebook...). |
timeout_seconds | int | Thời gian chờ tối đa (vd 60). |
poll_interval | int | Mỗi N giây server kiểm tra (vd 3). |
output | string | Chọn dữ liệu trả về: otp (mặc định), full, both. |
POST https://minisoftwares.net/system/api_otp_by_mail_oneshot.php
Header: X-API-KEY: YOUR_API_KEY
Body:
{
"email": "testmail01@outlook.com",
"password": "123456",
"rule_key": "tiktok",
"timeout_seconds": 60,
"poll_interval": 3,
"output": "both"
}Response thành công
{
"ok": true,
"mode": "oneshot",
"status": "done",
"otp": "482931",
"message_id": "AAMk...==",
"request_id": "AAMk...==",
"received_at": "2025-12-30T05:20:00Z",
"from": "TikTok <no-reply@tiktok.com>",
"subject": "Verification code",
"mailbox_id": 12,
"rule_key": "tiktok",
"output": "both",
"elapsed": 17.234,
"full_text": "Your TikTok verification code is 482931"
}4. Response timeout
{
"ok": false,
"mode": "oneshot",
"status": "timeout",
"error": "timeout_waiting_otp",
"timeout_sec": 60
}Copyright © 2026 Minisoftwares.Net. Design with
by Nguyen Van Sinh All rights reserved.