In this document, the backend endpoints and their behavior are documented. This description will subsequently serve as the basis for the development of the iOS and macOS app and for this reason should be as error-free as possible. Before pushing changes to this document, the Xcode project must be checked after using the endpoints and adjusted if necessary!
The information provided here is based on:
- the source code of the TrashMail.com backend
- the examined TrashMail-com frontend
- existing TrashMail extensions
- and the studied production backend using Postman.
To demonstrate the functionality in the best possible way, the test user "User" is used in the following examples. The requests and responses are not kept generic, but show the data of "User".
The structure of this document follows a clear structure. Each endpoint is introduced with.
- its address (URL) introduced
- defined with a short description of its functionality
- the expected input parameters (e.g. the structure of the JSON) specified
- specifies the expected output parameters (e.g. the structure of the JSON)
- and specified with possible hints or special features.
Each endpoint follows the same structure:
https://trashmail.com/?
api=1 & // Enables API functionality
lang=x & // en, de, fr
cmd=x // Depending on the function to be called
// Parameters are not specified in the URL as in REST, but in the HTTP body.
Error messages always have the same structure:
{
"success":false,
"error_code":x, // Error code > 0
"msg":"x" // Describes the error (or the code)
}
Success messages always have the same structure:
{
"success":true,
"error_code":0, // Code 0 corresponds to success
"msg":{...} // Depending on the endpoint Response to the request
}
The JSON property "msg" is returned in a different language depending on the HTTP GET(lang) set!
- login
- add_real_email
- set_default_email
- set_failover_email
- del_real_email
- add_domain
- status_domains
- del_domain
- list_domains
- list_real_emails
- logout
- del_account
- register_account
- reset_password
- change_password
- set_newsletter
- set_status
- send_status
- download_dea_csv
- save_settings
- read_user_data
- read_dea
- read_dea (Suche)
- set_rewrite_from
- set_rewrite_to
- set_log_emails
- set_subject_prefix
- set_sim_ml
- create_dea
- update_dea
- destroy_dea
- read_logging
- read_logging_raw_data
- read_logging_events
- del_logging
- send_logging_emails
- load_cs_messages
- save_cs_messages
- read_whitelist
- read_whitelist (Suche)
- whitelist_add
- whitelist_delete
- add_blacklist
- del_blacklist
- read_blacklist
- read_blacklist (Suche)
- edit_blacklist
- read_queue
- read_queue (Suche)
- queue_delete_msg
- queue_delete_all_msg
- queue_accept_msg
- send_mail
If the request is sent as x-www-form-urlencoded
:
The POST parameters must be URL-encoded: [1,2,3]
=> %5B1,2,3%5D
, [email protected]
=> mail%40domain.com
, etc. (For Swift: addingPercentEncoding
).
This endpoint enables login to the TrashMail.com server to subsequently access backend functionalities.
// Input
// HTTP method: POST
// Expected properties: fe-login-user, fe-login-pass
// Content-Type: application/json
{
"fe-login-user":"User", // String
"fe-login-pass":"secret" // String
}
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0, // Integer
"msg":{
"url":"https:\/\/trashmail.com\/?lang=en&cmd=manager", // String
"real_email_list":{
"[email protected]":true // Boolean
},
"domain_name_list":[
"0box.eu", // String...
"contbay.com",
"damnthespam.com",
"kurzepost.de",
"objectmail.com",
"proxymail.eu",
"rcpt.at",
"trash-mail.at",
"trashmail.at",
"trashmail.com",
"trashmail.io",
"trashmail.me",
"trashmail.net",
"wegwerfmail.de",
"wegwerfmail.net",
"wegwerfmail.org"
],
"session_id":"bk32m20sab2c6844dq968ouag3", // String
"preferences": { // Array
"DefaultCS": 0, // Integer
"DefaultDomain": "trashmail.com", // String
"DefaultFwds": 100, // Integer
"DefaultLifeSpan": 7, // Integer
"DefaultMasq": 1, // Integer
"DefaultNotify": 1, // Integer
"DefaultRealEmailAddress": "[email protected]", // String
"DefaultSortDir": "DESC", // String
"DefaultSortField": "ctime_text", // String
"notify-on-create-dea": true // Boolean
}
}
}
Notes:
- The call of this endpoint must be made before the call of other endpoints providing functionalities! If this is not adhered to, the error message "Not logged in or expired session." will be returned.
This endpoint logs the user out of the TrashMail.com server and resets the server-side session. After calling this endpoint, the login
endpoint must be called again to use the TrashMail.com server functionalities.
// Input
// HTTP method: POST
// Expected properties: -
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0 // Integer
}
Notes:
- None
Returns all real email addresses stored in the account.
// Input
// HTTP method: POST
// Expected properties: -
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0, // Integer
"data": {
"default_account_email":"[email protected]", // String
"real_email_list":[
"[email protected]", // String...
"[email protected]",
"[email protected]"
],
"failover_address":"[email protected]" // String
}
}
Notes:
- None
Adds a real email address to the account.
// Input
// HTTP method: POST
// Expected properties: email
// Content-Type: application/json
{
"email":"[email protected]" // String
}
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0 // Integer
}
Notes:
- If the request was successful, the email address will not yet appear among your own email addresses. A successful request will only trigger a confirmation email to the real email address and will only be assigned to the account afterwards.
Sets one of the real email addresses stored in the account as default.
// Input
// HTTP method: POST
// Expected properties: email
// Content-Type: application/json
{
"email":"[email protected]"
}
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0 // Integer
}
Notes:
- Non-existing email addresses will be rejected with the message "This email address needs to be confirmed first. Please check your email inbox for a confirmation email." rejected.
Sets one of the real email addresses stored in the account as failover.
// Input
// HTTP method: POST
// Expected properties: email
// Content-Type: application/json
{
"email":"[email protected]"
}
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0 // Integer
}
Notes:
- A failover address is optional. For this reason it can also be reset. For this purpose
"email":""
must be sent.
Removes one of the real email addresses stored in the account.
// Input
// HTTP method: POST
// Expected properties: email
// Content-Type: application/json
{
"email":"[email protected]"
}
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0, // Integer
"default_email":"[email protected]" // String
}
Notes:
- If the default email address is removed, another email address will automatically be set as default.
*Adds own domain to the account for personalized email addresses.
// Input
// HTTP method: POST
// Expected properties: domain
// Content-Type: application/json
{
"domain": "example.email" // String
}
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0, // Integer
"status":"Couldn't find 2 MX records, no MX entries found., missing SPF entry" // String
}
Notes:
- None
*Returns the current status for all domains stored in the account.
// Input
// HTTP method: POST
// Expected properties: -
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0, // Integer
"statusList":[
[
"example.com", // String...
"Error: Couldn't find 2 MX records, no MX entries found., missing SPF entry"
],
[
"example.net",
"Error: Couldn't find 2 MX records, no MX entries found., missing SPF entry"
]
]
}
Notes:
- To get the status of a single domain, the corresponding domain must be extracted from the array. There is no endpoint that can be explicitly requested for a domain.
Removes one of the domains stored in the account.
// Input
// HTTP method: POST
// Expected properties: domain
// Content-Type: application/json
{
"domain": "example.email" // String
}
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0 // Integer
}
Notes:
- When deleting a non-existent domain, no error description is returned:
{"success":false, "error_code":0}
.
Returns all domains stored in the account.
// Input
// HTTP method: POST
// Expected properties: -
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0, // Integer
"domainList":[
"0box.eu", // String...
"contbay.com",
"damnthespam.com",
"example.com",
"example.de",
"kurzepost.de",
"objectmail.com",
"proxymail.eu",
"rcpt.at",
"trash-mail.at",
"trashmail.at",
"trashmail.com",
"trashmail.io",
"trashmail.me",
"trashmail.net",
"wegwerfmail.de",
"wegwerfmail.net",
"wegwerfmail.org"
]
}
Notes:
- None
Removes an existing user account on TrashMail.com.
// Input
// HTTP method: POST
// Expected properties: -
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0, // Integer
"msg":"Account deleted." // String
}
Notes:
- The request does not specify which user should be removed. For security reasons only the logged in user can be removed (
{"success":false, "error_code":2, "msg": "Not logged in or expired session."}
).
Registers a new user account on TrashMail.com.
// Input
// HTTP method: POST
// Expected properties: email, user, pass, newsletter
// Content-Type: application/json
{
"email":"[email protected]", // String
"user":"User", // String
"pass":"secret", // String
"newsletter":true // Boolean
}
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0 // Integer
}
Notes:
- None
*Resets the password to an existing user account if it has been forgotten.
// Input
// HTTP method: POST
// Expected properties: email
// Content-Type: application/json
{
"email":"[email protected]" // String
}
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0 // Integer
}
Notes:
- This endpoint must not be confused with the "Change Password" function! This endpoint triggers an email with password reset instructions.
*Changes the password to an existing user account.
// Input
// HTTP method: POST
// Expected properties: pass-cfrm
// Content-Type: application/x-www-form-urlencoded
"pass-cfrm:apfel112" // Key-Value x-www-form-urlencoded
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0 // Integer
}
Notes:
- The new password is expected on the server side as a simple POST parameter. For this reason
application/x-www-form-urlencoded
must be used here instead of JSON.
*Enables or disables the sending of newsletters to the real email address stored in the account.
// Input
// HTTP method: POST
// Expected properties: newsletter
// Content-Type: application/json
{
"newsletter":true // Boolean
}
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0 // Integer
}
Notes:
- None
*Sets the frequency (e.g. weekly) at which status messages should be sent to the real email address.
// Input
// HTTP method: POST
// Expected properties: data
// Content-Type: application/x-www-form-urlencoded
"data: 7" // Key-Value x-www-form-urlencoded
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0, // Integer
"msg":"Status changed." // String
}
Notes:
- The frequency is expected on the server side as a simple GET/POST parameter. For this reason
application/x-www-form-urlencoded
must be used here instead of JSON.
*Triggers the sending of the status message manually to the real email address stored in the account.
// Input
// HTTP method: POST
// Expected properties: -
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0, // Integer
"msg":"Status sent." // String
}
Notes:
- None
*Returns all TrashMails belonging to the user account in CSV format.
// Input
// HTTP method: POST
// Expected properties: -
// Output
// Content-Type: text/plain;charset=UTF-8
// CSV-Rรผckgabe:
// Created at;Enabled;Disposable address;Destination;Description;Remaining forwards;Expire (days);Website;Whitelist;Reply-Masquerading;Notify;Last Received
// Aug 10, 2020;1;[email protected];[email protected];"";2;6;"";0;1;1;
// Aug 10, 2020;1;[email protected];trashmail_1@ example.email;"";2;6;"";0;1;1;
// Aug 10, 2020;1;[email protected];trashmail_1@ example.email;"";2;6;"";0;1;1;
// Aug 10, 2020;1;[email protected];trashmail_1@ example.email;"";2;6;"";0;1;1;
Notes:
- None
*Enables or disables sending a confirmation mail when a TrashMail is created.
// Input
// HTTP method: POST
// Expected properties: key, value
// Content-Type: application/x-www-form-urlencoded
"key:notify-on-create-dea" // Key-Value x-www-form-urlencoded
"value:true" // Key-Value x-www-form-urlencoded
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0 // Integer
}
Notes:
- None
*Returns all relevant user settings. This endpoint can be used to display settings in the user interface.
// Input
// HTTP method: POST
// Expected properties: -
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0, // Integer
"data":{
"status_repetition":7, // Integer
"notify_on_create_dea":true, // Boolean
"is_trashmail_plus_user":true, // Boolean
"trashmail_plus_expires_at":"Thu 10. Jun 10:40:55 CEST 2021", // String
"receive_newsletter":true, // Boolean
"rewrite_from": true, // Boolean
"rewrite_to": true, // Boolean
"log_emails": true, // Boolean
"sim_ml": true, // Boolean
"subject_prefix":"[TrashMail]" // String
}
}
Notes:
- If TrashMail Plus is not active (
is_trashmail_plus_user
= false), then an empty string is returned fortrashmail_plus_expires_at
. sim_ml
is short for "simulating mailing list" and represents the add mailing list unsubscribe option.
*Returns all TrashMails of the user account.
// Input
// HTTP method: POST
// Expected properties: -
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0, // Integer
"total":2, // Integer
"enabled":1, // Integer
"disabled":1, // Integer
"fwd_errors":0, // Integer
"fwd":1, // Integer
"rejected":0, // Integer
"data":[
{
"id":13549167, // Integer
"uid":39730391, // Integer
"ctime":1597054890, // Integer
"ctime_text":"Aug 10, 2020", // String
"last_received":0, // Integer
"last_received_text":"", // String
"from_name":"", // String
"disposable_name":"celia.rossler", // String
"disposable_domain":"0box.eu", // String
"destination":"[email protected]", // String
"enabled":true, // Boolean
"forwards":2, // Integer
"expire":6, // Integer
"website":"", // String
"cs":0, // Integer
"masq":true, // Boolean
"notify":true, // Boolean
"desc":"", // String
"blacklist_count":0, // Integer
"whitelist_count":0, // Integer
"queue_count":0, // Integer
"logging_count":0, // Integer
"fwd_errors":0, // Integer
"stats_fwd":0, // Integer
"stats_rejected":0 // Integer
}
]
}
Notes:
- None
*Returns all TrashMails for a specific search criterion of the user account.
// Input
// HTTP method: POST
// Expected properties: search
// Content-Type: application/x-www-form-urlencoded
"search:test" // Key-Value x-www-form-urlencoded
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0, // Integer
"total":2, // Integer
"enabled":1, // Integer
"disabled":1, // Integer
"fwd_errors":0, // Integer
"fwd":1, // Integer
"rejected":0, // Integer
"data":[
{
"id":13549167, // Integer
"uid":39730391, // Integer
"ctime":1597054890, // Integer
"ctime_text":"Aug 10, 2020", // String
"last_received":0, // Integer
"last_received_text":"", // String
"from_name":"", // String
"disposable_name":"test.rossler", // String
"disposable_domain":"0box.eu", // String
"destination":"[email protected]", // String
"enabled":true, // Boolean
"forwards":2, // Integer
"expire":6, // Integer
"website":"", // String
"cs":0, // Integer
"masq":true, // Boolean
"notify":true, // Boolean
"desc":"", // String
"blacklist_count":0, // Integer
"whitelist_count":0, // Integer
"queue_count":0, // Integer
"logging_count":0, // Integer
"fwd_errors":0, // Integer
"stats_fwd":0, // Integer
"stats_rejected":0 // Integer
}
]
}
Notes:
- None
*Enables or disables rewriting of the "From" header in forwarded emails.
// Input
// HTTP method: POST
// Expected properties: flag
// Content-Type: application/json
{
"flag":true // Boolean
}
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0 // Integer
}
Notes:
- None
*Enables or disables rewriting of the "To" header in forwarded emails.
// Input
// HTTP method: POST
// Expected properties: flag
// Content-Type: application/json
{
"flag":true // Boolean
}
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0 // Integer
}
Notes:
- None
*Enables or disables logging of email content at log.
// Input
// HTTP method: POST
// Expected properties: flag
// Content-Type: application/json
{
"flag":true // Boolean
}
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0 // Integer
}
Notes:
- None
*This can be used to set a prefix in the subject of each forwarded email.
// Input
// HTTP method: POST
// Expected properties: prefix
// Content-Type: application/json
{
"prefix":"[TrashMail]" // String
}
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0 // Integer
}
Notes:
- None
*Enables or disables the mailing list unsubscribe function.
// Input
// HTTP method: POST
// Expected properties: flag
// Content-Type: application/json
{
"flag":true // Boolean
}
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0 // Integer
}
Notes:
sim_ml
is the abbreviation for "simulating mailing list" and represents the option for "Add mailing list unsubscribe option".
*Removes TrashMails of the user account.
// Input
// HTTP method: POST
// Expected properties: data
// Content-Type: application/json
{
"data": "13549167" // String
}
// Mehrere TrashMails
{
"data": ["13549167", "13549165"] // String...
}
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0 // Integer
}
Notes:
- The deletion is not done by the name of the TrashMail, but by the ID, which returns e.g. at
read_dea
.
!!! TrashMail Plus Feature !!!
*Sends an email via the specified TrashMail.
Update 10.09.20:
Another JSON property authenticate_key
is introduced in the HTTP request. It contains a string with an authentication code for the iOS app to send emails without captcha code.
// Input
// HTTP method: POST
// Expected properties: from, to, cc, bcc, subject, body, send-copy
// Content-Type: application/json
{
"from":"[email protected]", // String
"to":"[email protected]", // String
"cc":"", // String
"bcc":"", // String
"subject":"Testnachricht", // String
"body":"<b>Hallo</b> zusammen!", // String
"send-copy":true, // Boolean
"authenticate_key":"fepqivnbk..." // String
}
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0 // Integer
}
Notes:
- None
!!! TrashMail-Plus feature (forwards > 10 and expiration > 1 month) !!!
*Creates a new TrashMail with the specified parameters.
// Input
// HTTP method: POST
// Expected properties: destination, from_name, disposable_name, disposable_domain, desc, website, enabled, forwards, expire, cs, notify, masq, catchAll, preferences
// Content-Type: application/json
// Classic
{
"data":{
"destination":"[email protected]", // String
"from_name":"Max Mustermann", // String
"disposable_name":"api_8", // String
"disposable_domain":"trashmail.com", // String
"desc":"Automatisch via Postman erstellt.", // String
"website":"postman.com", // String
"enabled":true, // Boolean
"forwards":10, // -1 entspricht unendlich! // Integer
"expire":12, // Integer
"cs":0, // Whitelist (0 Aus - 3 An, mit einmaligem Bestรคtigungscode) // Integer
"notify":true, // Ablaufmeldung // Boolean
"masq":true, // Antwort-Maskierung // Boolean
"catchAll":false, // Auto-Empfang-Email // Boolean
"preferences": { // Array
"DefaultCS": 0, // Integer
"DefaultDomain": "trashmail.com", // String
"DefaultFwds": 100, // Integer
"DefaultLifeSpan": 7, // Integer
"DefaultMasq": 1, // Integer
"DefaultNotify": 1, // Integer
"DefaultRealEmailAddress": "[email protected]", // String
"DefaultSortDir": "DESC", // String
"DefaultSortField": "ctime_text", // String
"notify-on-create-dea": true // Boolean
}
}
}
// Catch-All
{
"data":{
"destination":"[email protected]", // String
"from_name":"Max Mustermann", // String
"disposable_name":"*.api_9", // String
"disposable_domain":"trashmail.com", // String
"desc":"Automatisch via Postman erstellt.", // String
"website":"postman.com", // String
"enabled":true, // Boolean
"forwards":10, // Integer
"expire":12, // Integer
"cs":0, // Integer
"notify":true, // Boolean
"masq":true, // Boolean
"catchAll":true, // Boolean
"preferences": { // Array
"DefaultCS": 0, // Integer
"DefaultDomain": "trashmail.com", // String
"DefaultFwds": 100, // Integer
"DefaultLifeSpan": 7, // Integer
"DefaultMasq": 1, // Integer
"DefaultNotify": 1, // Integer
"DefaultRealEmailAddress": "[email protected]", // String
"DefaultSortDir": "DESC", // String
"DefaultSortField": "ctime_text", // String
"notify-on-create-dea": true // Boolean
}
}
}
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0, // Integer
"message":"Created disposable address", // String
"data":[
{
"id":13549797, // Integer
"uid":12345, // Integer
"destination":"[email protected]", // String
"cs":0, // Integer
"disposable_name":"api_8", // String
"disposable_domain":"trashmail.com", // String
"expire":12, // Integer
"forwards":10, // Integer
"masq":true, // Boolean
"notify":true, // Boolean
"website":"postman.com", // String
"preferences": {
// TODO
}
}
]
}
Notes:
- Several TrashMails can be created in one array at the same time.
!!! TrashMail-Plus feature (forwards > 10 and expiration > 1 month) !!!
*Changes the settings of a specific TrashMail.
// Input
// HTTP method: POST
// Expected properties: id (mandatory), enabled, from_name, disposable_name, disposable_domain, destination, desc, forwards, expire, website, cs, masq, notify, preferences
// Content-Type: application/json
// Zum Beispiel
{
"data":{
"id":"13549165", // String
"enabled":false, // Boolean
"preferences": { // Array
"DefaultCS": 0, // Integer
"DefaultDomain": "trashmail.com", // String
"DefaultFwds": 100, // Integer
"DefaultLifeSpan": 7, // Integer
"DefaultMasq": 1, // Integer
"DefaultNotify": 1, // Integer
"DefaultRealEmailAddress": "[email protected]", // String
"DefaultSortDir": "DESC", // String
"DefaultSortField": "ctime_text", // String
"notify-on-create-dea": true // Boolean
}
}
}
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0, // Integer
"preferences": { // Array
"DefaultCS": 0, // Integer
"DefaultDomain": "trashmail.com", // String
"DefaultFwds": 100, // Integer
"DefaultLifeSpan": 7, // Integer
"DefaultMasq": 1, // Integer
"DefaultNotify": 1, // Integer
"DefaultRealEmailAddress": "[email protected]", // String
"DefaultSortDir": "DESC", // String
"DefaultSortField": "ctime_text", // String
"notify-on-create-dea": true // Boolean
}
}
Notes: **
- Not all values have to be set! It is enough if the value to be changed is specified in the JSON.
- Several TrashMails can be changed at the same time in one array.
*Reads the log of a specific TrashMail.
// Input
// HTTP method: POST
// Expected properties: id
// Content-Type: application/x-www-form-urlencoded
"id:13549165" // Key-Value x-www-form-urlencoded
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0, // Integer
"data":[
{
"id":1336740, // Integer
"ctime":1597144087, // Integer
"ctime_text":"Aug 11, 2020, 1:08:07 PM GMT+2", // String
"from":"[email protected]", // String
"message_id":"<[email protected]>", // String
"fwd":"[email protected]", // String
"subject":"Hallo", // String
"status":"STATUS_BOUNCED", // String
"status_text":"Error" // String
}
]
}
Notes:
- None
https://trashmail.com/?api=1&lang=en&cmd=read_logging_raw_data
*Returns the email content of a specific log entry.
// Input
// HTTP method: POST
// Expected properties: id, output
// Content-Type: application/x-www-form-urlencoded
// Accept: application/json
"id:1336740" // Key-Value x-www-form-urlencoded
// Output
// Content-Type: application/json
{
"success": true, // Boolean
"error_code": 0, // Integer
"data": "From [email protected]..." // String
}
Notes:
- The content type is determined by the HTTP header
accept
. Currently available areapplication/json
andtext/plain
.
https://trashmail.com/?api=1&lang=en&cmd=read_logging_events
*Returns the events of a specific log entry.
// Input
// HTTP method: POST
// Expected properties: id
// Content-Type: application/x-www-form-urlencoded
"id:1353059" // Key-Value x-www-form-urlencoded
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0, // Integer
"data":[
{
"id":3943009, // Integer
"ctime":1597223356, // Integer
"ctime_text":"Aug 12, 2020, 11:09:16 AM GMT+2", // String
"event":"NOT_ON_WHITELIST_HOLD_EMAIL", // String
"event_data": "", // String
"event_text":"Not on whitelist, hold email in queue.", // String
"envelope_sender":"[email protected]", // String
"to":"[email protected]", // String
"relay":"mail.aionda.com[2a01:4f8:c0c:a2d2::1]:25", // String
"sender":"a.mxout.trashmail.com" // String
}
]
}
Notes:
- None
*Deletes a specific entry from the log list.
// Input
// HTTP method: POST
// Expected properties: idList
// Content-Type: application/x-www-form-urlencoded
"idList:[1337278]" // Key-Value x-www-form-urlencoded
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0 // Integer
}
Notes:
- Multiple IDs can be specified, these are separated by commas
[1,2,3]
.
https://trashmail.com/?api=1&lang=en&cmd=send_logging_emails
*Resends the email from the log to the specified email address.
// Input
// HTTP method: POST
// Expected properties: idList, fwd
// Content-Type: application/x-www-form-urlencoded
"idList:[1337275]" // Key-Value x-www-form-urlencoded
"fwd:[email protected]" // Key-Value x-www-form-urlencoded
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0 // Integer
}
Notes:
- Multiple IDs can be specified, these are separated by commas
[1,2,3]
. - The fwd mail address must be a real email address stored in the account.
*Returns the individual notifications (e.g. if confirmation code is required for delivery) for a given TrashMail.
// Input
// HTTP method: POST
// Expected properties: data
// Content-Type: application/x-www-form-urlencoded
'data:["39730821","wl-confirm"]' // Key-Value x-www-form-urlencoded
// wl-confirm, confirm-every, confirm-off
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0, // Integer
"data":{
"from_name":"TrashMail.com", // String
"from_email":"[email protected]", // String
"subject":"$REPLY", // String
"body":"Hello,\n\nthis email address $USER@$DOMAIN requires manual confirmation.\nPlease confirm your sent email by going on the following URL address:\n$CONFIRMATION_URL\n\nFor more information: Please visit https:\/\/trashmail.com\/\n\n-- Sent message follows --\n$EMAIL\n-- End of sent message --\n\n-- \nThe TrashMail robot.\nhttps:\/\/trashmail.com\/\n" // String
}
}
Notes: **
- The ID specified in the request is not the "ID" of the TrashMail, but the "UID" of the TrashMail! Contained in the return of the DEAs:
{"id": "13549165", "uid": "39730389", ...
.
*Saves a different version of the individual notifications (e.g. if confirmation code for delivery is required) for a specific TrashMail.
// Input
// HTTP method: POST
// Expected properties: param, name, from, subject, body
// Content-Type: application/x-www-form-urlencoded
'param:["39730821","wl-confirm"]' // Key-Value x-www-form-urlencoded
'name:Testroboter' // Key-Value x-www-form-urlencoded
'from:[email protected]' // Key-Value x-www-form-urlencoded
'subject:Test' // Key-Value x-www-form-urlencoded
'body:Hallo!' // Key-Value x-www-form-urlencoded
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0 // Integer
}
Notes: **
- The ID specified in the request is not the "ID" of the TrashMail, but the "UID" of the TrashMail! Contained in the return of the DEAs:
{"id": "13549165", "uid": "39730389", ...
.
*Returns all entries of the whitelist of a specific TrashMail.
// Input
// HTTP method: POST
// Expected properties: user_id
// Content-Type: application/x-www-form-urlencoded
"user_id:39730389" // Key-Value x-www-form-urlencoded
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0, // Integer
"data":[
{
"id":45617, // Integer
"email":"[email protected]", // String
"ctime":1597155087, // Integer
"ctime_text":"8\/11\/20, 4:11 PM" // String
}
]
}
Notes: **
- The ID specified in the request is not the "ID" of the TrashMail, but the "UID" of the TrashMail! Contained in the return of the DEAs:
{"id": "13549165", "uid": "39730389", ...
.
*Returns the whitelist entries of a given TrashMail that match the search criterion.
// Input
// HTTP method: POST
// Expected properties: user_id, search
// Content-Type: application/x-www-form-urlencoded
"user_id:39730389" // Key-Value x-www-form-urlencoded
"search:test" // Key-Value x-www-form-urlencoded
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0, // Integer
"data":[
{
"id":45619, // Integer
"email":"[email protected]", // String
"ctime":1597155486, // Integer
"ctime_text":"8\/11\/20, 4:18 PM" // String
}
]
}
Notes: **
- The ID specified in the request is not the "ID" of the TrashMail, but the "UID" of the TrashMail! Contained in the return of the DEAs:
{"id": "13549165", "uid": "39730389", ...
.
*Adds an email address to the whitelist of a specific TrashMail.
// Input
// HTTP method: POST
// Expected properties: data
// Content-Type: application/x-www-form-urlencoded
'data:["39730389","[email protected]"]' // Key-Value x-www-form-urlencoded
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0 // Integer
}
Notes: **
- The ID specified in the request is not the "ID" of the TrashMail, but the "UID" of the TrashMail! Contained in the return of the DEAs:
{"id": "13549165", "uid": "39730389", ...
.
*Removes an email address from the whitelist of a specific TrashMail.
// Input
// HTTP method: POST
// Expected properties: data
// Content-Type: application/x-www-form-urlencoded
"data:45618" // Key-Value x-www-form-urlencoded
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0 // Integer
}
Notes:
- The data id is the
id
returned byread_whitelist
.
*Adds an email address to the blacklist of a specific TrashMail.
// Input
// HTTP method: POST
// Expected properties: id, description, mail_from, subject, body
// Content-Type: application/x-www-form-urlencoded
"id:13544576" // Key-Value x-www-form-urlencoded
"description:Testregel" // Key-Value x-www-form-urlencoded
"mail_from:[email protected]" // Key-Value x-www-form-urlencoded
"subject:" // Key-Value x-www-form-urlencoded
"body:" // Key-Value x-www-form-urlencoded
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0 // Integer
}
Notes:
- None
*Removes an email address from the blacklist of a specific TrashMail.
// Input
// HTTP method: POST
// Expected properties: id
// Content-Type: application/x-www-form-urlencoded
"id:297" // Key-Value x-www-form-urlencoded
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0 // Integer
}
Notes:
- The
id
is returned forread_blacklist
.
*Returns all blacklist entries of a specific TrashMail.
// Input
// HTTP method: POST
// Expected properties: id
// Content-Type: application/x-www-form-urlencoded
"id:13544576" // Key-Value x-www-form-urlencoded
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0, // Integer
"data":[
{
"id":299, // Integer
"description":"TestA", // String
"mail_from":"[email protected]", // String
"subject":"", // String
"body":"", // String
"rejected":0, // Integer
"last_rejection_time_text":"-", // String
"last_rejection_body":"", // String
"ctime_text":"8\/11\/20", // String
"ctime": 123456 // Integer
}
]
}
Notes:
- None
*Returns the blacklist entries of a given TrashMail that match the search criterion.
// Input
// HTTP method: POST
// Expected properties: id, search
// Content-Type: application/x-www-form-urlencoded
"id:13544576" // Key-Value x-www-form-urlencoded
"search:test" // Key-Value x-www-form-urlencoded
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0, // Integer
"data":[
{
"id":299, // Integer
"description":"TestA", // String
"mail_from":"[email protected]", // String
"subject":"", // String
"body":"", // String
"rejected":0, // Integer
"last_rejection_time_text":"-", // String
"last_rejection_body":"", // String
"ctime_text":"8\/11\/20", // String
"ctime": 123456 // Integer
}
]
}
Notes:
- None
*Edits an entry in the blacklist of a TrashMail.
// Input
// HTTP method: POST
// Expected properties: id (einzig verpflichtend), description, mail_from, subject, body
// Content-Type: application/x-www-form-urlencoded
"id:299" // Key-Value x-www-form-urlencoded
"description:Das ist eine neue Beschreibung!" // Key-Value x-www-form-urlencoded
"subject:Hallo!" // Key-Value x-www-form-urlencoded
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0 // Integer
}
Notes:
- It is not always necessary to pass all values. It is sufficient if the value to be changed (e.g.
description
) is passed. However, it is mandatory to pass theid
for server-side identification.
*Returns all queue entries of a given TrashMail.
// Input
// HTTP method: POST
// Expected properties: user_id
// Content-Type: application/x-www-form-urlencoded
"user_id:39705691" // Key-Value x-www-form-urlencoded
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0, // Integer
"data":[
{
"id":17797197, // Integer
"ctime":1597219948, // Integer
"ctime_text":"8\/12\/20, 10:12 AM", // String
"sender_addr":"[email protected]", // String
"subject":"Test" // String
}
]
}
Notes: **
- The ID specified in the request is not the "ID" of the TrashMail, but the "UID" of the TrashMail! Contained in the return of the DEAs:
{"id": "13549165", "uid": "39730389", ...
.
*Returns the queue entries of a given TrashMail that match the search criterion.
// Input
// HTTP method: POST
// Expected properties: user_id, search
// Content-Type: application/x-www-form-urlencoded
"user_id:39705691" // Key-Value x-www-form-urlencoded
"search:Zweiter" // Key-Value x-www-form-urlencoded
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0, // Integer
"data":[
{
"id":17797197, // Integer
"ctime":1597219948, // Integer
"ctime_text":"8\/12\/20, 10:12 AM", // String
"sender_addr":"[email protected]", // String
"subject":"Zweiter Test" // String
}
]
}
Notes: **
- The ID specified in the request is not the "ID" of the TrashMail, but the "UID" of the TrashMail! Contained in the return of the DEAs:
{"id": "13549165", "uid": "39730389", ...
.
*Deletes a specific email from the queue of a specific TrashMail.
// Input
// HTTP method: POST
// Expected properties: data
// Content-Type: application/x-www-form-urlencoded
"data:17797197" // Key-Value x-www-form-urlencoded
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0 // Integer
}
Notes:
- None
https://trashmail.com/?api=1&lang=en&cmd=queue_delete_all_msg
*Deletes all emails from the queue of a specific TrashMail.
// Input
// HTTP method: POST
// Expected properties: data
// Content-Type: application/x-www-form-urlencoded
"data:39705691" // Key-Value x-www-form-urlencoded
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0 // Integer
}
Notes: **
- The ID specified in the request is not the "ID" of the TrashMail, but the "UID" of the TrashMail! Contained in the return of the DEAs:
{"id": "13549165", "uid": "39730389", ...
.
*Accepts an email from the queue of a specific TrashMail.
// Input
// HTTP method: POST
// Expected properties: data
// Content-Type: application/x-www-form-urlencoded
"data:17797209" // Key-Value x-www-form-urlencoded
// Output
// Content-Type: application/json
{
"success":true, // Boolean
"error_code":0 // Integer
}
Notes:
- All waiting emails from the same sender will be allowed through.