Skip to content
Get an API key
Reference

Messages

2 endpoints in this family.

Get the layout of a received email

GET/api/v1/inbox/messages/{id}/html

Returns the cleaned HTML of an email, kept apart from the thread so listing messages stays light. A message with no kept layout returns 404.

Path parameters

  • idstring

    The message id.

Response

`{ html }`, sanitised.

  • data.htmlstring

    Sanitised HTML, without scripts.

curl https://coplace.io/api/v1/inbox/messages/<id>/html \ -H "Authorization: Bearer $COPLACE_KEY"

Response

200 OK
{ "data": { "html": "…" }}

Download the file attached to a message

GET/api/v1/inbox/messages/{id}/media

Returns the file itself. A WhatsApp file is read from the gateway that keeps it; once the gateway no longer has it, the route answers 410 media_expired.

Path parameters

  • idstring

    The message id.

Query parameters

  • pieceinteger

    For an email with attachments, which one (0-based).

Response

The file, with its content type.

curl https://coplace.io/api/v1/inbox/messages/<id>/media \ -H "Authorization: Bearer $COPLACE_KEY"

Returns the file itself, not wrapped: its type is in Content-Type.