مرجع API
المسودات والمرفقات
ابنِ تدفقات المحرر مع تخزين خاص للمرفقات.
لا توجد عمليات تطابق عامل التصفية هذا.
POST
مفتاح API/draftsأنشئ مسودة في المحرر
أنشئ مسودة في المحرر
curl https://sendhq.cc/api/v1/drafts \
-X POST \
-H "Authorization: Bearer $SENDHQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{"from":"hello@example.com","to":["customer@example.net"],"subject":"Hello"}'{
"id": "dr_…",
"attachments": []
}GET
مفتاح API/draftsاعرض مسودات المحرر
اعرض مسودات المحرر
curl https://sendhq.cc/api/v1/drafts \
-X GET \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"data": [],
"count": 0
}GET
مفتاح API/drafts/:idاسترجع مسودة ومرفقاتها
استرجع مسودة ومرفقاتها
curl https://sendhq.cc/api/v1/drafts/id_value \
-X GET \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"id": "dr_…",
"attachments": []
}PUT
مفتاح API/drafts/:idاستبدل محتوى المسودة
استبدل محتوى المسودة
curl https://sendhq.cc/api/v1/drafts/id_value \
-X PUT \
-H "Authorization: Bearer $SENDHQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{"from":"hello@example.com","to":["customer@example.net"],"subject":"Updated subject","text":"Updated body"}'{
"id": "dr_…"
}DELETE
مفتاح API/drafts/:idتخلَّ عن مسودة
تخلَّ عن مسودة
curl https://sendhq.cc/api/v1/drafts/id_value \
-X DELETE \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"ok": true
}POST
مفتاح API/drafts/:id/attachmentsارفع مرفقًا إلى مسودة
ارفع بايتات الملف الخام. اضبط Content-Type وX-Filename. يمكن أن تحتوي الرسالة على 10 ملفات كحد أقصى وبإجمالي 10 MB.
curl https://sendhq.cc/api/v1/drafts/id_value/attachments \
-X POST \
-H "Authorization: Bearer $SENDHQ_API_KEY" \
-H "Content-Type: application/pdf" \
-H "X-Filename: invoice.pdf" \
--data-binary @invoice.pdf{
"id": "att_…",
"filename": "invoice.pdf",
"sizeBytes": 48231,
"available": true
}GET
مفتاح API/attachments/:idنزّل مرفقًا خاصًا
نزّل مرفقًا خاصًا
curl https://sendhq.cc/api/v1/attachments/id_value \
-X GET \
-H "Authorization: Bearer $SENDHQ_API_KEY"DELETE
مفتاح API/attachments/:idاحذف مرفقًا خاصًا
احذف مرفقًا خاصًا
curl https://sendhq.cc/api/v1/attachments/id_value \
-X DELETE \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"ok": true
}GET
مفتاح API/sending-identitiesاعرض هويات المُرسِل الموثَّقة
اعرض هويات المُرسِل الموثَّقة
curl https://sendhq.cc/api/v1/sending-identities \
-X GET \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"domains": [],
"addresses": [],
"localParts": []
}