API - Disposable.Network
We will be offering API access to people that donate to the server. To donate, send an email to contact@disposable.network
List Domains:
Get the current list of available domains.
https://disposable.network/api/domains/[apikey]
Parameters:
[apikey] - Key which you may have set in your Admin Panel of TMail.
Returns:
Array of strings. Ex: ['au-c.com','ex-z.com','w-do.com','fc-e.com','dj-l.com','is-o.com']
NodeJS ES6 Example
import axios from 'axios';
async function get_domain_list(api_key){
var url = `https://disposable.network/api/domains/${api_key}`;
const { data } = await axios.get(
url
);
return data;
}
(async () = {
var api_key = 'key-goes-here';
console.log(await api.get_domain_list(api_key));
})();
Create Email:
Validate the Email ID and provides a sanitized one.
https://disposable.network/api/email/[email]/[apikey]
Parameters:
[apikey] - Key which you may have set in your Admin Panel of TMail.
[email] - Email ID that you want to create.
Returns:
String with email you created. Ex: test2@au-c.com
NodeJS ES6 Example
import axios from 'axios';
async function create_email(api_key, email){
var url = `https://disposable.network/api/email/${email}/${api_key}`;
const { data } = await axios.get(
url
);
return data;
}
(async () = {
var api_key = 'key-goes-here';
var email = 'test2@au-c.com';
console.log(await api.create_email(api_key,email));
})();
Fetch Messages:
Get email messages of the provided Email ID.
https://disposable.network/api/messages/[email]/[apikey]
Parameters:
[apikey] - Key which you may have set in your Admin Panel of TMail.
[email] - Email ID that you want to create.
Returns:
[
{
subject: 'test',
sender_name: 'Jim Lahey',
sender_email: 'c@email.com',
timestamp: '2024-01-04T13:22:18.000000Z',
date: '04 Jan 2024 01:22 PM',
datediff: '2 minutes ago',
id: 24,
content: 'div dir="ltr"test message!divbr/divdiva target="blank" href="https://www.npmjs.com/package/axios-retry"https://www.npmjs.com/package/axios-retry/abr/divdivbr/divdiv-lol/div/div',
attachments: []
},
]
NodeJS ES6 Example
import axios from 'axios';
async function fetch_messages(api_key, email){
var url = `https://disposable.network/api/messages/${email}/${api_key}`;
const { data } = await axios.get(
url
);
return data;
}
(async () = {
var api_key = 'key-goes-here';
var email = 'test2@au-c.com';
console.log(await api.fetch_messages(api_key, email));
})();
Delete Message:
Delete a specific email message with the given ID.
https://disposable.network/api/message/[message_id]/[apikey]
Parameters:
[apikey] - Key which you may have set in your Admin Panel of TMail.
[message_id] - Unique identifier for the specific message to delete.
NodeJS ES6 Example
import axios from 'axios';
async function delete_message(api_key, message_id){
var url = `https://disposable.network/api/message/${message_id}/${api_key}`;
try{
await axios.delete(url);
return `Deleted post with ID ${message_id}`;
} catch (ex) {
return `error: ${ex}`;
}
}
(async () = {
var api_key = 'key-goes-here';
var id = '24';
console.log(await api.delete_message(api_key, id));
})();