Getting started overview
Integrating with the MailboxValidator API involves a sequence of steps designed to get you from account creation to your first successful email validation request. The primary goal is to enable real-time verification of email addresses to ensure data accuracy and reduce delivery issues. This guide focuses on the initial setup, API key management, and executing a basic validation call.
The MailboxValidator service offers an API for email validation, alongside specific SDKs for various programming languages including PHP, Python, Ruby, Java, C#, and Node.js. These SDKs are designed to streamline the integration process by abstracting direct HTTP requests. For direct API interaction, the service typically uses RESTful principles with JSON responses, a common approach for web APIs as outlined by W3C architectural styles.
The following table provides a quick reference for the essential steps:
| Step | What to Do | Where |
|---|---|---|
| 1. Create Account | Register for a MailboxValidator account. | MailboxValidator Pricing Page or MailboxValidator Homepage |
| 2. Get API Key | Locate and copy your unique API key from the dashboard. | MailboxValidator Dashboard (after login) |
| 3. Make Request | Construct and send an API request using your key and an email address. | Your preferred development environment (e.g., cURL, Postman, SDK) |
| 4. Interpret Response | Parse the JSON response to understand validation results. | MailboxValidator API Documentation |
Create an account and get keys
To begin using MailboxValidator, you must first create an account. This process typically involves providing an email address and setting a password. MailboxValidator offers a free tier that includes 100 free validations per month, allowing you to test the service without immediate financial commitment. Paid plans start at $19.95 per month for 2,000 validations, with various pricing tiers available for higher volumes.
Once your account is set up and you have logged into the MailboxValidator dashboard, your unique API key will be displayed. This key is essential for authenticating all your API requests. Treat your API key as a sensitive credential, similar to a password. It should not be exposed in client-side code, committed directly to public repositories, or shared unnecessarily. Best practices for API key security often include using environment variables or a secure key management system, as described in guides like Google Cloud's API key security overview.
Locating your API key:
- Navigate to the MailboxValidator homepage.
- Click on the "Login" button and enter your credentials.
- Once logged into your dashboard, the API key is typically prominently displayed. Copy this key, as it will be required for every API call.
Your first request
After obtaining your API key, you can make your first email validation request. The MailboxValidator API is accessed via a simple HTTP GET request. The primary endpoint for single email validation is designed to be straightforward, requiring only the email address to be validated and your API key.
The base URL for the API is generally https://api.mailboxvalidator.com/v1/validation/single. You will append query parameters for email and key to this URL.
Example Request (using cURL):
curl -X GET "https://api.mailboxvalidator.com/v1/validation/[email protected]&key=YOUR_API_KEY"
Replace [email protected] with the email address you wish to validate and YOUR_API_KEY with the key obtained from your MailboxValidator dashboard.
Example JSON Response:
{
"email_address": "[email protected]",
"domain": "example.com",
"is_free": "True",
"is_syntax_valid": "True",
"is_domain_valid": "True",
"is_smtp_valid": "True",
"is_verified": "True",
"is_server_down": "False",
"is_greylisted": "False",
"is_disposable": "False",
"is_robot": "False",
"is_marketing_valid": "True",
"is_in_blacklist": "False",
"is_proxy": "False",
"is_frequent_complainer": "False",
"is_spam_trap": "False",
"mailboxvalidator_score": "0.95",
"result": "True",
"status": "Valid",
"reason": "",
"custom_domain": "False",
"credits_available": "99",
"error_code": "",
"error_message": ""
}
The response provides detailed information about the email address, including its syntax validity, domain validity, SMTP validation status, and an overall result and status. The mailboxvalidator_score offers a consolidated measure of validity. For a complete list of response parameters and their meanings, refer to the MailboxValidator API documentation.
Common next steps
After successfully making your first API call, you can explore further integration options and features:
- Integrate with an SDK: For most applications, using one of the provided SDKs (PHP, Python, Ruby, Java, C#, Node.js) is recommended. SDKs handle HTTP requests, error parsing, and authentication, simplifying development. You can find links to these SDKs within the MailboxValidator API documentation.
- Batch Validation: If you need to validate large lists of emails, MailboxValidator offers a bulk email validation API. This is more efficient than making individual requests for each email and is suitable for cleaning existing databases.
- Error Handling: Implement robust error handling in your application. The API returns specific error codes and messages for issues like invalid API keys, rate limits, or malformed requests. Understanding these will help your application gracefully manage unexpected responses.
- Webhook Integration: For asynchronous processing or real-time notifications, investigate if MailboxValidator offers webhook capabilities. Webhooks allow the API to notify your application when certain events occur, which can be useful for post-validation actions. While not directly detailed in the getting started, webhooks are a common pattern for event-driven architectures, as discussed in Twilio's webhook security guide.
- Monitor Usage: Regularly check your API usage within the MailboxValidator dashboard to ensure you stay within your plan limits and to anticipate when an upgrade might be necessary.
- Explore Advanced Features: Review the full API documentation for advanced features such as custom domain settings, specific validation checks, or integration with other services.
Troubleshooting the first call
Encountering issues during your first API call is common. Here are some typical problems and their solutions:
- Invalid API Key:
- Symptom: The API returns an error indicating an invalid or missing API key.
- Solution: Double-check that you have copied the API key correctly from your MailboxValidator dashboard. Ensure there are no leading or trailing spaces, and that it is passed as the
keyparameter in your request.
- Missing Email Parameter:
- Symptom: An error indicating that the email parameter is missing.
- Solution: Verify that the
emailparameter is correctly included in your GET request URL, for example,[email protected].
- Rate Limit Exceeded:
- Symptom: The API returns a rate limit error, even on your first call.
- Solution: This is less common for a single first call but can occur if you've made multiple rapid attempts. Wait a short period and try again. Review your plan's rate limits on the MailboxValidator pricing page.
- Network Issues:
- Symptom: Your request times out or fails to connect to the API endpoint.
- Solution: Check your internet connection. Ensure there are no firewall rules or proxy settings blocking outgoing HTTP requests to
api.mailboxvalidator.com.
- Incorrect Endpoint:
- Symptom: A 404 Not Found error or an unexpected response structure.
- Solution: Confirm that you are using the correct API endpoint URL:
https://api.mailboxvalidator.com/v1/validation/single. Refer to the MailboxValidator API documentation for the exact endpoint details.
- JSON Parsing Errors:
- Symptom: Your application fails to parse the API response.
- Solution: Ensure your code is correctly set up to handle JSON responses. Use a JSON parser library appropriate for your programming language. Verify that the response is indeed valid JSON, which can be checked using online JSON validators.