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を設定してください。1通のメッセージに含められるのは、最大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検証済みの送信者IDを一覧表示する
検証済みの送信者IDを一覧表示する
curl https://sendhq.cc/api/v1/sending-identities \
-X GET \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"domains": [],
"addresses": [],
"localParts": []
}