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": []
}