Get OTP Code
Extract an OTP code or confirmation link from the last unread email message.
Endpoint: POST /api/mail/last-unread-otp-or-link
Extract an OTP code or confirmation link from the last unread email message.
Request Headers
Authorization: Bearer your_api_token_here
Content-Type: application/json
Request Body
{
"email": "ms3cgwumw0@mloqq.com"
}
Response with OTP and Confirmation Link
{
"otp": "123456",
"confirmation_link": "https://example.com/verify?token=abc123"
}
Response with OTP Only
{
"otp": "654321",
"confirmation_link": null
}
Response with Confirmation Link Only
{
"otp": null,
"confirmation_link": "https://example.com/confirm?token=xyz789"
}
Response with No OTP or Link
{
"message": "No OTP code or confirmation link found in the last unread message"
}
Usage Examples
JavaScript (fetch)
fetch('https://mailblinker.com/api/mail/last-unread-otp-or-link', {
method: 'POST',
headers: {
'Authorization': 'Bearer 5720c4dbb4601183486a9259a8e8f7b9b6fef2dc61f34ee901516995710e49aa',
'Content-Type': 'application/json'
},
body: JSON.stringify({ email: 'ms3cgwumw0@mloqq.com' })
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
Python (requests)
import requests
import sys
sys.stdout.reconfigure(encoding='utf-8')
url = 'https://mailblinker.com/api/mail/last-unread-otp-or-link'
headers = {
'Authorization': 'Bearer 5720c4dbb4601183486a9259a8e8f7b9b6fef2dc61f34ee901516995710e49aa',
'Content-Type': 'application/json'
}
data = {
'email': 'ms3cgwumw0@mloqq.com'
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
cURL
curl -X POST https://mailblinker.com/api/mail/last-unread-otp-or-link \
-H "Authorization: Bearer your_api_token_here" \
-H "Content-Type: application/json" \
-d '{"email": "ms3cgwumw0@mloqq.com"}'