#
API lấy thông tin hòm thư
#
1. Tạo Task
#
API Endpoint
POST
https://api.muamail.store/tools/get-messages/
#
Tham số truy vấn
{
"email": "your-mail",
"password": "your-password"
"client_id": "your-client-id",
"refresh_token": "your-refresh-token",
"method": "METHOD"
}
#
Kết quả trả về
{
"is_success": true,
"data": "d4b2cedd-f6ae-4913-9c1d-526c3e3a58c9",
"message": "Thành công"
}
#
Code mẫu
import requests
import json
url = "https://api.muamail.store/tools/get-messages/"
payload = json.dumps({
"email": "[email protected]",
"client_id": "your-client-id",
"refresh_token": "your-refresh-token"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
class Program
{
static async Task Main(string[] args)
{
var client = new HttpClient();
var data = new
{
email = "[email protected]",
client_id = "your-client-id",
refresh_token = "your-refresh-token"
};
var json = JsonConvert.SerializeObject(data);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://api.muamail.store/tools/get-messages/"),
Content = content
};
try
{
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (HttpRequestException e)
{
Console.WriteLine($"Request error: {e.Message}");
}
Console.ReadLine();
}
}
const axios = require("axios");
let data = JSON.stringify({
email: "[email protected]",
client_id: "your-client-id",
refresh_token: "your-refresh-token",
});
let config = {
method: "post",
maxBodyLength: Infinity,
url: "https://api.muamail.store/tools/get-messages/",
headers: {
"Content-Type": "application/json",
},
data: data,
};
axios
.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
#
2. Lấy kết quả Task
#
API Endpoint
POST
https://api.muamail.store/tools/get-messages/YOUR_TASK_ID/
#
Tham số truy vấn
#
Kết quả trả về
{
"success": true,
"data": [
{
"subject": "Subject from email",
"from": "[email protected]",
"text": "text from email",
"html": "<html></html>",
"date": "dd/mm/yyy hh:mm:ss"
}
],
"message": "Lấy danh sách hòm thư thành công"
}