Kirim Email Api Key Vimanamail memiliki kemampuan untuk mengirimkan email menggunakan API (Application Programming Interface) berbasis protocol HTTPS dengan JSON REST API.
console vimanamail : https://stayclean.vimanamail.id/
Sebelum memulai, pastikan beberapa hal berikut:
- Fungsi SMTP Outgoing sudah enable dan memiliki API Key sebagai credential yang wajib dimiiki HERE
- IP Pengirim sudah masuk ke daftar Allowlist (biasanya merupakan IP server tempat aplikasi berada)
Step 1:
Service location and request structure auth
HTTP Method/URI:
Method: POST
https://api.defend.my.id/v2/auth.php
Request Body AUTH:
{
"apikey":"apikey",
"domain":"Alamat domain pengirim"
}
Name | Data Type | Descripty |
---|---|---|
apikey | String | Api key yang didapat dari vimana console |
domain | String | Alamat domain pengirim |
Successful response auth
{
"errlog":0,
"errdesc":”success”
"token": "9h***2h****",
"dtvalid": 1710475859
}
Failed response auth
Code | Description |
fire_100 | Terjadi kesalahan pada server |
fire_101 | Http method tidak valid |
fire_102 | Parameter request Header Authorization tidak valid |
fire_103 | Parameter request Body tidak valid |
Step 2:
Service location and request structure vimana
Method: POST
https://api.defend.my.id/v2/vimana.php
Request Header VIMANA:
[
"Authorization: Token dari respon auth",
]
Name | Data Type | Description |
---|---|---|
Authorization | String | Token di dapatkan dari step 1 |
Request Body VIMANA:
{
"emailfromname":"Email Sender Name",
"emailfrom":"email@sender.com",
"emailtoname":["Email Recipient Name"],
"emailto":["email@recipient.com"],
"emailsubject":"Email Subject",
"emailbody":"Email Body",
"attachmentname":["filename.jpg"],
"attachmentfile":["base64code"]
}
Name | Data Type | Description |
---|---|---|
emailfromname | String | Nama pengirim email |
emailfrom | String | Alamat pengirim email |
emailtoname | Array | Nama penerima email |
emailto | Array | Alamat penerima email |
emailsubject | String | Subject email |
emailbody | String | Isi email, mendukung format html/plain text |
attachmentname | Array | Nama file attachment (optional) |
attachmentfile | Array | Code base64 file attachment (optional) |
Successful response vimana
{
"errlog":0,
"errdesc":”success”
}
Failed response vimana
Code | Description |
fire_100 | Terjadi kesalahan pada server |
fire_101 | Http method tidak valid |
fire_102 | Parameter request Header Authorization tidak valid |
fire_103 | Parameter request Body tidak valid |
fire_104 | Format alamat email tidak valid |
fire_105 | Filter SMTP: SenderDomainRejected, SenderIPRejected, OverQuotaDaily, OverQuotaMonthly, AttachmentSizeExceeded, SizeExceeded, OverQuotaRecipient, BlockEmailSender, BlockEmailRecipient, BlockDomainRecipient |