Mengirim Email Menggunakan API Key V2

API Informasi Teknis

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://console.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"
}
NameData TypeDescripty
apikeyStringApi key yang didapat dari vimana console
domainStringAlamat domain pengirim

Successful response auth

{
	"errlog":0,
	"errdesc":”success”
        "token": "9h***2h****",
        "dtvalid": 1710475859
}

Failed response auth

CodeDescription
fire_100Terjadi kesalahan pada server
fire_101Http method tidak valid
fire_102Parameter request Header Authorization tidak valid
fire_103Parameter 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",
]
NameData TypeDescription
AuthorizationStringToken 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"]
}
NameData TypeDescription
emailfromnameStringNama pengirim email
emailfromStringAlamat pengirim email
emailtonameArrayNama penerima email
emailtoArrayAlamat penerima email
emailsubjectStringSubject email
emailbodyStringIsi email, mendukung format html/plain text
attachmentnameArrayNama file attachment (optional)
attachmentfileArrayCode base64 file attachment (optional)

Successful response vimana

{
	"errlog":0,
	"errdesc":”success”
}

Failed response vimana

CodeDescription
fire_100Terjadi kesalahan pada server
fire_101Http method tidak valid
fire_102Parameter request Header Authorization tidak valid
fire_103Parameter request Body tidak valid
fire_104Format alamat email tidak valid
fire_105Filter SMTP: SenderDomainRejected, SenderIPRejected, OverQuotaDaily, OverQuotaMonthly, AttachmentSizeExceeded, SizeExceeded, OverQuotaRecipient, BlockEmailSender, BlockEmailRecipient, BlockDomainRecipient