Email Validator: Walidacja
Zweryfikuj e-maile
Waliduj do 50 adresów w jednym poleceniu. Są sprawdzane równolegle i wracają w kolejności, w jakiej je wysłałeś.
https://g.sendcorex.com/v1/tool/validatecommand: validate_emailsWymaga scope tools:validate w twoim API key.
1 kredyt na unikalny adres. Powtórzone adresy są walidowane i liczone raz, i pojawiają się raz w results.
Jeśli twoje kredyty nie pokrywają całej listy, nic nie jest walidowane: dostajesz INSUFFICIENT_CREDITS z informacją, ile potrzebujesz i ile masz.
Argumenty
emailsstring[]wymaganeOd 1 do 50 adresów.
np.
["ana@acme.com", "jhon@gmial.com"]
Szybki start
import axios from 'axios';
const response = await axios.post(
'https://g.sendcorex.com/v1/tool/validate',
{
commands: [
{
command: "validate_emails",
args: {
emails: [
"ana@acme.com",
"jhon@gmial.com"
]
}
}
]
},
{ headers: { Authorization: process.env.SENDCOREX_API_KEY } },
);
const [result] = response.data.results;
if (result.type !== 'SUCCESS') throw new Error(`${result.code}: ${result.message}`);
console.log(result.data);Odpowiedź
{
"type": "SUCCESS",
"results": [
{
"command": "validate_emails",
"id": "0",
"type": "SUCCESS",
"took_ms": 18,
"data": {
"results": [
{
"email": "ana@acme.com",
"valid": true,
"checks": [
{
"check": "Format Validation",
"status": "Passed",
"details": "Valid email format"
},
{
"check": "Local Part Validation",
"status": "Passed",
"details": "Local part is RFC compliant"
},
{
"check": "Role-based Email Check",
"status": "Passed",
"details": "Not a role-based address"
},
{
"check": "No-reply Email Check",
"status": "Passed",
"details": "Not a no-reply address"
},
{
"check": "Temporary Email Check",
"status": "Passed",
"details": "Not a temporary email"
},
{
"check": "Misspelled Domain Check",
"status": "Passed",
"details": "Correct"
},
{
"check": "Spam Trap Check",
"status": "Passed",
"details": "Not a spam trap"
},
{
"check": "Provider Type",
"status": "Passed",
"details": "Corporate or custom domain"
},
{
"check": "Domain Validation",
"status": "Passed",
"details": "Domain is valid and has MX records"
},
{
"check": "Null MX Check",
"status": "Passed",
"details": "Domain accepts email"
},
{
"check": "Email Provider Detection",
"status": "Passed",
"details": "Domain is hosted on a known provider: Google Workspace",
"providerId": 1,
"providerName": "Google Workspace"
},
{
"check": "Email Deliverability",
"status": "Passed",
"details": "Mailbox exists",
"fullResponse": "250 2.1.5 OK"
},
{
"check": "Catch-all Mail Exchanger Check",
"status": "Passed",
"details": "Mail exchanger correctly rejects nonexistent addresses"
}
]
},
{
"email": "jhon@gmial.com",
"valid": false,
"checks": [
{
"check": "Format Validation",
"status": "Passed",
"details": "Valid email format"
},
{
"check": "Local Part Validation",
"status": "Passed",
"details": "Local part is RFC compliant"
},
{
"check": "Role-based Email Check",
"status": "Passed",
"details": "Not a role-based address"
},
{
"check": "No-reply Email Check",
"status": "Passed",
"details": "Not a no-reply address"
},
{
"check": "Temporary Email Check",
"status": "Passed",
"details": "Not a temporary email"
},
{
"check": "Misspelled Domain Check",
"status": "Failed",
"details": "Possible typo. Suggested correction: jhon@gmail.com"
},
{
"check": "Spam Trap Check",
"status": "Passed",
"details": "Not a spam trap"
},
{
"check": "Provider Type",
"status": "Passed",
"details": "Corporate or custom domain"
},
{
"check": "Domain Validation",
"status": "Failed",
"details": "Invalid domain or no MX records"
}
]
}
],
"count": 2,
"valid_count": 1,
"invalid_count": 1,
"credits_used": 2
}
}
]
}Pola odpowiedzi
resultsJeden wynik na unikalny adres, w kolejności, w jakiej je wysłałeś.
count / valid_count / invalid_countIle sprawdzono oraz ile okazało się prawidłowych i nieprawidłowych.
credits_usedKredyty zużyte przez to polecenie.
results[].emailAdres, bez spacji i małymi literami.
results[].validtruetylko wtedy, gdy każda kontrola została zaliczona.Provider TypeiEmail Provider Detectionsą informacyjne i nigdy nie zmieniają tego nafalse.results[].checks[].checkNazwa kontroli. Zobacz Kontrole poniżej.
results[].checks[].statusPassedlubFailed.results[].checks[].detailsZdanie wyjaśniające wynik, gotowe do pokazania użytkownikowi.
results[].checks[].fullResponseTylko przy
Email Deliverability: dokładna odpowiedź serwera skrzynki.results[].checks[].providerId / providerNameTylko przy
Email Provider Detection: dostawca poczty hostujący domenę.
Duże listy
Dla tysięcy adresów wywołuj to polecenie porcjami po 50, jedno po drugim, albo prześlij plik w dashboardzie (Email Validator → Lists): jest walidowany w tle, a po zakończeniu dostajesz e-mail z plikiem CSV.
Błędy
Błędy na poziomie HTTP zwracają type, code i message. Błędy oznaczone CMD wracają w wyniku polecenia, z HTTP 200.
- 401
INVALID_API_KEYAPI key nie istnieje, został unieważniony lub wyłączony w panelu.
- 429
RATE_LIMITEDPonad 75 żądań/s lub 75 w toku dla tego samego IP + API key. Odczekaj liczbę sekund z Retry-After.
- CMD
MISSING_SCOPEAPI key nie ma `tools:validate`.
- CMD
INVALID_ARGSArgument jest nieprawidłowy: brak email (lub domain dla `check_disposable`), ponad 50 e-maili, adres dłuższy niż 254 znaki, limit poza zakresem…
- CMD
INSUFFICIENT_CREDITSNie masz dość kredytów na całe polecenie (kredyty walidacji dla `validate_*`, kredyty sprawdzania jednorazowych adresów dla `check_disposable`). Nic nie zostało sprawdzone i nic nie zostało pobrane.
- CMD
CREDITS_UNAVAILABLENie udało się teraz odczytać twoich kredytów. Nic nie zostało pobrane. Spróbuj ponownie.
- CMD
NO_SERVERS_AVAILABLEŻaden serwer walidacji nie jest teraz dostępny. Nic nie zostało pobrane. Spróbuj ponownie za chwilę.
- CMD
VALIDATION_FAILEDSerwery walidacji nie odpowiedziały na czas. Twoje kredyty zostały zwrócone. Spróbuj ponownie.
- CMD
INTERNALBłąd serwera. Szczegóły trafiają tylko do logu serwera.