The lukas/disposable-emails v1.0.0 API is organized around multiple Web Services and protocols (REST, SOAP etc.). Allowing you to speed up the implementation by choosing the technology you are most familiar with and the one that best suits your needs.
You can use the lukas/disposable-emails API in test mode, which does not affect your request limits. The API key you use to authenticate the request determines whether it is live mode or test mode.
We put a lot of time and effor for the API's to be backward compatible but with new features available this may not be possible. If you wish we can notify you when the new version of the API is released.
https://assetsapi.com/lukas/disposable-emails/v1.0.0/soap/wsdl
https://assetsapi.com/lukas/disposable-emails/v1.1.0/soap/call
Choose the language you're going to use to implement the API. Examples will be adjusted accordingly.
The lukas/disposable-emails API uses API keys to authenticate requests. You can view and manage your API keys in the API Keys section.
Test mode secret keys have the prefix test_
and live mode secret keys have the prefix live_
.
Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
Open your application configuration file, where you hold all sensitive information. This is the file where environment setup is stored, such as database credentials, cache drivers, API keys etc.
Add constant defines and wsld cache settings to the configuration file.
<?php // settings.php
// ...
defined("LUKAS_DISPOSABLE_EMAILS_SECRET") OR
define("LUKAS_DISPOSABLE_EMAILS_SECRET",
"test_YOUR_API_KEY_HASH");
defined("LUKAS_DISPOSABLE_EMAILS_WSDL") OR
define("LUKAS_DISPOSABLE_EMAILS_WSDL",
"https://assetsapi.com/lukas/disposable-emails/v1.0.0/soap/wsdl");
// Enable WSDL caching
ini_set('soap.wsdl_cache_enabled', true);
ini_set('soap.wsdl_cache_ttl', 86400);
The lukas/disposable-emails v1.0.0 SOAP API returns erros as SOAP faults. A SOAP fault response has HTTP status code and contains an XML-formatted error message in the response body.
In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.). Codes in the 5xx range indicate an error with our server.
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>1001</faultcode>
<faultstring>Could not resolve host</faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
PHP Fatal error: SOAP Fault: (code: 1001, msg: Could not resolve host)
# | Message | Description |
---|---|---|
200 | OK | Everything worked as expected. |
400 | Bad Request | The request was unacceptable, often due to missing a required parameter. |
401 | Unauthorized | No valid API key provided. |
402 | Request Failed | The parameters were valid but the request failed. |
403 | Forbidden | The API key doesn't have permissions to perform the request. |
404 | Not Found | The requested asset doesn't exist. |
409 | Conflict | The request conflicts with another request (perhaps due to using the same idempotent key). |
422 | Results Limit Reached | You have reached or will soon reach your results limit. |
429 | Too Many Requests | Too many requests hit the API too quickly. We recommend an exponential backoff of your requests. |
500, 502, 503, 504 | Server Errors | Something went wrong on the server end. Those are logged and promptly fixed. |
$assetsAPISoap = new \SoapClient(LUKAS_DISPOSABLE_EMAILS_WSDL, [
'login' => LUKAS_DISPOSABLE_EMAILS_SECRET,
'soap_version' => SOAP_1_2,
'features' => SOAP_SINGLE_ELEMENT_ARRAYS
]);
$requestObj = (object)[
'options' => (object)[
]
];
try {
$responseObj = $assetsAPISoap->getWrongAsset($requestObj);
} catch (\SoapFault $fault) {
trigger_error("SOAP Fault: (code: {$fault->faultcode}" .
", msg: {$fault->faultstring})", E_USER_ERROR);
}
PHP Fatal error: SOAP Fault: (code: 404, msg: The requested asset doesn't exist.)
Suppliers offering disposable email service
Attributes |
Example | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
integer | id | 1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Primary key | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
string | domain | temp-mail.io | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Disposable email supplier / host | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
timestamp | created_at | 2021-09-02 06:08:55 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Date and time when the record was created | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
timestamp | updated_at | 2022-12-19 14:47:22 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Date and time when the record was updated |
$assetsAPISoap = new \SoapClient(LUKAS_DISPOSABLE_EMAILS_WSDL, [
'login' => LUKAS_DISPOSABLE_EMAILS_SECRET,
'soap_version' => SOAP_1_2,
'features' => SOAP_SINGLE_ELEMENT_ARRAYS
]);
$requestObj = (object)[
'options' => (object)[
]
];
try {
$responseObj = $assetsAPISoap->getSuppliers($requestObj);
} catch (\SoapFault $fault) {
trigger_error("SOAP Fault: (code: {$fault->faultcode}" .
", msg: {$fault->faultstring})", E_USER_ERROR);
}
{ "success": true, pagination: {...},
"data": [
{
"id": "1",
"domain": "Est deleniti et sequi est minima magni",
"created_at": "2024-12-26 10:35:17",
"updated_at": "2024-12-26 10:35:17"
}, ...
]
}
Temporary email domains used by suppliers.
Attributes |
Example | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
integer | id | 1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Primary key | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
string | domain | greencafe24.com | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Domain name used for the temporary emails | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
integer | supplier_id | 1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ID of the Supplier / host where temporary email domain has last been seen | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
timestamp | created_at | 2021-09-02 06:08:55 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Date and time when the record was created | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
timestamp | updated_at | 2021-09-02 06:08:55 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Date and time when the record was updated |
$assetsAPISoap = new \SoapClient(LUKAS_DISPOSABLE_EMAILS_WSDL, [
'login' => LUKAS_DISPOSABLE_EMAILS_SECRET,
'soap_version' => SOAP_1_2,
'features' => SOAP_SINGLE_ELEMENT_ARRAYS
]);
$requestObj = (object)[
'options' => (object)[
]
];
try {
$responseObj = $assetsAPISoap->getTemporaryEmails($requestObj);
} catch (\SoapFault $fault) {
trigger_error("SOAP Fault: (code: {$fault->faultcode}" .
", msg: {$fault->faultstring})", E_USER_ERROR);
}
{ "success": true, pagination: {...},
"data": [
{
"id": "1",
"domain": "Velit ullam impedit aperiam voluptatem est",
"supplier_id": 22,
"created_at": "2024-12-26 10:35:17",
"updated_at": "2024-12-26 10:35:17"
}, ...
]
}