Geliştirici API Entegrasyon Kılavuzu
ugiMail Verification API, geçici e-posta oluşturma ve doğrulama süreçlerini kendi yazılımlarınıza entegre etmenizi sağlayan basit, güvenli ve yüksek hızlı bir HTTP tabanlı arayüzdür. Otomasyon araçları, otomatik üyelik test yazılımları ve diğer API entegrasyonu gerektiren tüm projelerinizde sorunsuzca kullanabilirsiniz.
API Temel (Base) URL
Tüm API isteklerinizi göndereceğiniz temel adres:
https://mail.ugilabs.com/public_api
Hız Sınırları (Rate Limit)
Sistem kaynaklarını korumak, aşırı yüklenmeleri engellemek ve genel güvenliği sağlamak amacıyla istemci IP adresine göre hız sınırları (Rate Limiting) uygulanmaktadır.
Aynı IP adresi saatte en fazla 10 yeni e-posta adresi üretebilir.
Inbox sorgulama, süre uzatma ve silme işlemleri dakikada en fazla 60 kez çağrılabilir.
Yanıt ve Hata Kodları
| HTTP Kodu | Anlamı | Açıklama |
|---|---|---|
| 200 OK | Başarılı | İşlem başarıyla tamamlandı. Yanıt JSON gövdesi içerisindedir. |
| 400 Bad Request | Geçersiz Parametre | Gerekli parametreler eksik veya e-posta adresi biçimi hatalı. |
| 404 Not Found | Bulunamadı | Sorgulanan e-posta adresi aktif listesinde kayıtlı değil. |
| 410 Gone | Süresi Dolmuş | E-posta adresi aktif olmuş fakat 5 dakikalık geçerlilik süresi tükenmiş. |
| 429 Too Many Requests | Hız Limiti Aşıldı | Dakikalık veya saatlik hız limiti sınırlarına takıldınız. İstek engellendi. |
| 500 Internal Error | Sunucu Hatası | Sunucu kaynaklı veya sunucumuzla olan bağlantı nedeniyle oluşan beklenmedik hata. |
API Uç Noktaları (Endpoints)
?action=generate&prefix={prefix}
E-Posta Oluştur
Geçici bir e-posta adresi üretir. Eğer prefix parametresi gönderilirse (sadece alfa-numerik karakterler), ön ek olarak kullanılır (Örn: prefix-xxxx@ugilabs.com). 10 dakikalık geçerlilik süresiyle sisteme kaydedilir.
| Parametre | Tür | Gerekli mi? | Açıklama |
|---|---|---|---|
| prefix | String | Hayır | Oluşturulacak e-postanın başına eklenecek özel ön ek. |
{"success":true,"email":"prefix-k8m3n8pq@ugilabs.com","expires_at":1783849200,"expires_in":600,"delete_token":"9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d"}
?action=inbox&email={email}
Gelen Kutusu, OTP, Doğrulama Linki ve Ek Ayrıştırma
Belirtilen e-posta adresine gelen son 30 e-postayı sorgular. Mesajlarda bulunan Discord onay tokenlarını, genel tek kullanımlık onay kodlarını (otp), genel doğrulama bağlantılarını (verification_url) ve ek dosyaları (attachments) otomatik ayrıştırıp döner.
| Parametre | Tür | Gerekli mi? | Açıklama |
|---|---|---|---|
| String | Evet | Daha önce sistemde oluşturulmuş aktif e-posta adresi. |
{"success":true,"messages":[{"id":4,"subject":"Hesap Onay Kodu","from":"Servis Adi ","date":"12.07.2026 01:45","body":"...","htmlBody":"...","token":"829104","otp":"829104","verification_url":"https://site.com/verify?code=829104","attachments":[{"id":"d1e2f3g4","filename":"fatura.pdf","size":45120,"download_url":"http://site.com/download?email=...&file_id=d1e2f3g4"}]}]}
?action=extend&email={email}
Süreyi Uzat (+5 Dakika)
Sorgulanan e-posta adresinin geçerlilik süresini her çağrıda 5 dakika (300 saniye) daha uzatır. Bu işlem, e-postanın süresi dolmadan önce yapılmalıdır.
{"success":true,"email":"k8m3n8pq@ugilabs.com","expires_at":1783849500}
?action=delete&email={email}&token={delete_token}
Kutuyu Kapat ve Temizle
E-posta adresinin aktif listesindeki kaydını siler ve bu adrese gönderilmiş olan tüm e-postaları sunucumuzdan kalıcı olarak kaldırır.
{"success":true,"message":"E-posta adresi ve mailler kalici olarak silindi","deleted_mails_count":2}
Entegrasyon Kod Şablonları
curl "https://mail.ugilabs.com/public_api?action=generate"
curl "https://mail.ugilabs.com/public_api?action=inbox&email=test-xxxx@ugilabs.com"
curl "https://mail.ugilabs.com/public_api?action=extend&email=test-xxxx@ugilabs.com"
curl "https://mail.ugilabs.com/public_api?action=delete&email=test-xxxx@ugilabs.com&token=DELETE_TOKEN"
async function runMailFlow() {
const api = "https://mail.ugilabs.com/public_api";
try {
const responseGen = await fetch(api + "?action=generate");
const dataGen = await responseGen.json();
if (!dataGen.success) return;
const email = dataGen.email;
await new Promise(resolve => setTimeout(resolve, 5000));
const responseInbox = await fetch(api + "?action=inbox&email=" + encodeURIComponent(email));
const dataInbox = await responseInbox.json();
if (dataInbox.success && dataInbox.messages.length > 0) {
const verificationCode = dataInbox.messages[0].otp;
const verificationUrl = dataInbox.messages[0].verification_url;
}
const deleteToken = dataGen.delete_token;
const responseDel = await fetch(api + "?action=delete&email=" + encodeURIComponent(email) + "&token=" + encodeURIComponent(deleteToken));
const dataDel = await responseDel.json();
} catch (error) {
console.error(error);
}
}
import requests
import time
def process_automation():
url = "https://mail.ugilabs.com/public_api"
try:
r_gen = requests.get(url, params={"action": "generate"}).json()
if not r_gen.get("success"):
return None
email = r_gen.get("email")
delete_token = r_gen.get("delete_token")
time.sleep(5)
r_inbox = requests.get(url, params={"action": "inbox", "email": email}).json()
if r_inbox.get("success") and len(r_inbox.get("messages", [])) > 0:
otp = r_inbox["messages"][0].get("otp")
ver_url = r_inbox["messages"][0].get("verification_url")
r_del = requests.get(url, params={"action": "delete", "email": email, "token": delete_token}).json()
return r_del
except Exception as e:
return None
<?php
function call_api_flow($action, $params = []) {
$url = "https://mail.ugilabs.com/public_api?action=" . urlencode($action);
foreach ($params as $k => $v) {
$url .= "&" . urlencode($k) . "=" . urlencode($v);
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true);
}
$gen = call_api_flow("generate");
if (isset($gen["success"]) && $gen["success"]) {
$email = $gen["email"];
$token = $gen["delete_token"];
sleep(5);
$inbox = call_api_flow("inbox", ["email" => $email]);
if (isset($inbox["success"]) && !empty($inbox["messages"])) {
$otp = $inbox["messages"][0]["otp"];
}
$delete = call_api_flow("delete", ["email" => $email, "token" => $token]);
}
using System;
using System.Net.Http;
using System.Threading.Tasks;
public class MailFlowService
{
private static readonly HttpClient client = new HttpClient();
public async Task ExecuteFlowAsync()
{
string baseUrl = "https://mail.ugilabs.com/public_api";
try
{
HttpResponseMessage genRes = await client.GetAsync(baseUrl + "?action=generate");
string genJson = await genRes.Content.ReadAsStringAsync();
if (genJson.Contains("\"success\":true"))
{
string email = ExtractJsonValue(genJson, "email");
string token = ExtractJsonValue(genJson, "delete_token");
await Task.Delay(5000);
HttpResponseMessage inboxRes = await client.GetAsync(baseUrl + "?action=inbox&email=" + email);
string inboxJson = await inboxRes.Content.ReadAsStringAsync();
HttpResponseMessage delRes = await client.GetAsync(baseUrl + "?action=delete&email=" + email + "&token=" + token);
string delJson = await delRes.Content.ReadAsStringAsync();
}
}
catch (Exception)
{
}
}
private string ExtractJsonValue(string json, string key)
{
string pattern = "\"" + key + "\":\"";
int start = json.IndexOf(pattern);
if (start == -1) return string.Empty;
start += pattern.Length;
int end = json.IndexOf("\"", start);
return json.Substring(start, end - start);
}
}
package main
import (
"encoding/json"
"net/http"
"net/url"
"time"
)
type GenResponse struct {
Success bool `json:"success"`
Email string `json:"email"`
DeleteToken string `json:"delete_token"`
}
func runFlow() {
client := &http.Client{Timeout: 10 * time.Second}
api := "https://mail.ugilabs.com/public_api"
rGen, err := client.Get(api + "?action=generate")
if err != nil {
return
}
defer rGen.Body.Close()
var genRes GenResponse
json.NewDecoder(rGen.Body).Decode(&genRes)
if genRes.Success {
time.Sleep(5 * time.Second)
rInbox, _ := client.Get(api + "?action=inbox&email=" + url.QueryEscape(genRes.Email))
rInbox.Body.Close()
rDel, _ := client.Get(api + "?action=delete&email=" + url.QueryEscape(genRes.Email) + "&token=" + url.QueryEscape(genRes.DeleteToken))
rDel.Body.Close()
}
}
API Kullanım ve Entegrasyon Kılavuzu
Geçici e-posta servisinin entegrasyonu, yazılım ve bot projelerinde doğrulama işlemlerini tamamen otomatik hale getirmek için tasarlanmıştır. Bu bölüm, servisi nerede, nasıl ve hangi pratik adımlarla kullanacağınızı detaylandırır.
Nerede Kullanılır? (Kullanım Alanları)
Nasıl Kullanılır? (Temel Kullanım Adımları)
?action=generate ucuna istek atarak anlık bir e-posta adresi alın. Dilerseniz prefix ekleyerek özelleştirin.
?action=inbox&email=email_adresi adresi üzerinden gelen kutusunu belirli aralıklarla (örneğin 5 saniyede bir) sorgulayın.
otp (tek kullanımlık şifre) veya verification_url (doğrulama linki) değerlerini doğrudan kullanın.
?action=delete&email=email_adresi isteği göndererek e-posta adresini ve tüm ilişkili verileri kalıcı olarak silin.
Örnek Entegrasyon Senaryosu
test-bot-abc@ugilabs.com adresini oluşturur.
inbox API ucunu sorgular. Discord'dan gelen e-posta yakalandığında, API yanıtındaki verification_url değerini alır.
verification_url adresine HTTP isteği göndererek e-posta doğrulama aşamasını başarıyla tamamlar.
delete API ucu çağrılarak e-posta kutusu kapatılır ve tüm veriler sunucudan temizlenir.