Tích hợp API
Tài liệu hướng dẫn tích hợp SlimEmail API
Base URL dùng chung: https://user.slimemail.vn
Mọi request là dạng POST, dữ liệu gửi dưới dạng application/x-www-form-urlencoded.
🔒 Yêu cầu bắt buộc
api_key: API key trong cài đặt SlimEmail.app_path: Đường dẫn cài đặt SlimEmail, ví dụhttps://user.slimemail.vn.
1. 🎯 Đăng ký nhận tin (Subscribe)
Endpoint: /subscribe
Tham số yêu cầu:
api_key
✅
API key
list
✅
List ID (danh sách đăng ký)
email
✅
Email người dùng
name
❌
Tên người dùng
boolean
❌
Trả về true/false thay vì thông báo HTML (true hoặc false)
Ví dụ:
POST https://user.slimemail.vn/subscribeBody:
api_key=YOUR_API_KEY
app_path=https://user.slimemail.vn
list=LIST_ID
[email protected]
name=John Doe
boolean=true2. ❌ Huỷ đăng ký (Unsubscribe)
Endpoint: /unsubscribe
Tham số yêu cầu:
api_key
✅
API key
list
✅
List ID
email
✅
Email cần huỷ
Ví dụ:
POST https://user.slimemail.vn/unsubscribeBody:
api_key=YOUR_API_KEY
app_path=https://user.slimemail.vn
list=LIST_ID
[email protected]3. 🗑️ Xoá người đăng ký (Delete Subscriber)
Endpoint: /api/subscribers/delete.php
Tham số yêu cầu:
api_key
✅
API key
list
✅
List ID
email
✅
Email cần xoá
Ví dụ:
POST https://user.slimemail.vn/api/subscribers/delete.phpBody:
api_key=YOUR_API_KEY
app_path=https://user.slimemail.vn
list=LIST_ID
[email protected]4. 📨 Tạo và gửi chiến dịch (Create & Send Campaigns)
Endpoint: /api/campaigns/create.php
Tham số yêu cầu:
api_key
✅
API key
from_name
✅
Tên người gửi
from_email
✅
Email người gửi
reply_to
✅
Email trả lời
title
✅
Tiêu đề chiến dịch
subject
✅
Tiêu đề email
plain_text
❌
Nội dung text (tuỳ chọn)
html_text
✅
Nội dung HTML
list_ids
✅
Danh sách ID (ngăn cách dấu phẩy nếu nhiều)
send_campaign
✅
1 để gửi ngay
brand_id
❌
Nếu không dùng list_ids
Ví dụ:
POST https://user.slimemail.vn/api/campaigns/create.phpBody:
api_key=YOUR_API_KEY
app_path=https://user.slimemail.vn
from_name=SlimCRM
[email protected]
[email protected]
title=Chiến dịch tháng 6
subject=Khám phá tính năng mới!
html_text=<h1>Xin chào!</h1><p>Chúng tôi vừa cập nhật hệ thống...</p>
list_ids=abc123xyz
send_campaign=15. 🔎 Kiểm tra trạng thái đăng ký (Subscription Status)
Endpoint: /api/subscribers/subscription-status.php
Tham số yêu cầu:
api_key
✅
API key
list_id
✅
List ID
email
✅
Email cần kiểm tra
Phản hồi có thể là:
SubscribedUnsubscribedUnconfirmedBouncedSoft bouncedComplainedEmail does not exist in list
Ví dụ:
POST https://user.slimemail.vn/api/subscribers/subscription-status.phpBody:
api_key=YOUR_API_KEY
app_path=https://user.slimemail.vn
list_id=abc123xyz
[email protected]6. 📊 Đếm số lượng subscriber đang hoạt động
Endpoint: /api/subscribers/active-subscriber-count.php
Tham số yêu cầu:
api_key
✅
API key
list_id
✅
List ID
Ví dụ:
POST https://user.slimemail.vn/api/subscribers/active-subscriber-count.phpBody:
api_key=YOUR_API_KEY
app_path=https://user.slimemail.vn
list_id=abc123xyzPhản hồi:
Trả về số lượng subscriber đang hoạt động dưới dạng số.
Last updated