API-referentie

Concepten en bijlagen

Bouw flows voor het opstellen van berichten met privéopslag voor bijlagen.

POST/drafts
API-sleutel

Een concept aanmaken

Een concept aanmaken

Request
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"}'
201-respons
{
  "id": "dr_…",
  "attachments": []
}
GET/drafts
API-sleutel

Concepten opvragen

Concepten opvragen

Request
curl https://sendhq.cc/api/v1/drafts \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200-respons
{
  "data": [],
  "count": 0
}
GET/drafts/:id
API-sleutel

Een concept en de bijlagen ophalen

Een concept en de bijlagen ophalen

Request
curl https://sendhq.cc/api/v1/drafts/id_value \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200-respons
{
  "id": "dr_…",
  "attachments": []
}
PUT/drafts/:id
API-sleutel

De inhoud van een concept vervangen

De inhoud van een concept vervangen

Request
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"}'
200-respons
{
  "id": "dr_…"
}
DELETE/drafts/:id
API-sleutel

Een concept verwijderen

Een concept verwijderen

Request
curl https://sendhq.cc/api/v1/drafts/id_value \
  -X DELETE \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200-respons
{
  "ok": true
}
POST/drafts/:id/attachments
API-sleutel

Een bijlage uploaden naar een concept

Upload de ruwe bytes van het bestand. Stel Content-Type en X-Filename in. Een bericht kan maximaal 10 bestanden en in totaal 10 MB bevatten.

Optionele headersX-Filename
Request
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
201-respons
{
  "id": "att_…",
  "filename": "invoice.pdf",
  "sizeBytes": 48231,
  "available": true
}
GET/attachments/:id
API-sleutel

Een privébijlage downloaden

Een privébijlage downloaden

Request
curl https://sendhq.cc/api/v1/attachments/id_value \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
DELETE/attachments/:id
API-sleutel

Een privébijlage verwijderen

Een privébijlage verwijderen

Request
curl https://sendhq.cc/api/v1/attachments/id_value \
  -X DELETE \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200-respons
{
  "ok": true
}
GET/sending-identities
API-sleutel

Geverifieerde afzenderidentiteiten opvragen

Geverifieerde afzenderidentiteiten opvragen

Request
curl https://sendhq.cc/api/v1/sending-identities \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200-respons
{
  "domains": [],
  "addresses": [],
  "localParts": []
}