Pular para o conteúdo

Obter mensagem

GET
/messages/{id}
curl --request GET \
"https://api.iporto.com.br/api/external/v1/messages/3f2a7c18-9d4e-4b6a-8c1f-5e2d7a0b3f49" \
--header "Authorization: Bearer $IPORTO_API_KEY" \
--header "Accept: application/json"

Uma mensagem, pelo tracking_code que o envio devolveu ou pelo message.id da listagem.

Só aqui vêm delivery.bounce — o código e a frase do servidor de destino — e delivery.recipients, o resultado de cada destinatário. Na listagem o primeiro é nulo e o segundo é lista vazia, porque buscá-los para cada item deixaria a lista lenta.

⚠️ O tracking_code continua resolvendo depois do arquivamento, que acontece poucos minutos depois de a mensagem terminar. É por isso que ele, e não o id, é o identificador para guardar.

id
required
string
/^([0-9a-fA-F]{24}|[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/

O message.tracking_code que o envio devolveu (o caminho normal), ou o message.id que veio na listagem. Os dois resolvem a mesma mensagem.

channel
string
default: email
Allowed values: email sms

O canal: email (padrão) ou sms. Valor inválido responde 422.

A mensagem.

Media typeapplication/json

O mesmo objeto que o webhook entrega em param.details (v1) e data (v2). Cada campo está descrito em https://docs.iporto.com.br/api/webhooks/eventos/

object
object
string
nullable
event
nullable
channel
string
nullable
message
object
id
string
nullable
tracking_code
string
nullable
message_id
string
nullable
message_id_relay
string
nullable
subject
string
nullable
body
nullable
from
string
nullable
from_visible
string
nullable
to
string
nullable
recipients
Array<string>
tags
Array<string>
smtp_domain_id
integer
smtp_account_id
integer
plan_type
string
nullable
attachments_dropped
Array
sent_at
string
nullable
delivery
object
status
string
nullable
hard_bounce
integer
soft_bounce
integer
discarded
integer
trap
integer
bounce
object
kind
string
nullable
code
string
nullable
answer
string
nullable
domain
string
nullable
recipients
Array<object>
object
email
string
nullable
domain
string
nullable
kind
string
nullable
code
string
nullable
answer
string
nullable
discard_reason
nullable
engagement
object
link
string
nullable
ip
string
nullable
user_agent
string
nullable
device
string
nullable
platform
string
nullable
referer
nullable
Examplegenerated
{
"object": "example",
"event": "example",
"channel": "example",
"message": {
"id": "example",
"tracking_code": "example",
"message_id": "example",
"message_id_relay": "example",
"subject": "example",
"body": "example",
"from": "example",
"from_visible": "example",
"to": "example",
"recipients": [
"example"
],
"tags": [
"example"
],
"smtp_domain_id": 1,
"smtp_account_id": 1,
"plan_type": "example",
"attachments_dropped": [
"example"
],
"sent_at": "example"
},
"delivery": {
"status": "example",
"hard_bounce": 1,
"soft_bounce": 1,
"discarded": 1,
"trap": 1,
"bounce": {
"kind": "example",
"code": "example",
"answer": "example",
"domain": "example"
},
"recipients": [
{
"email": "example",
"domain": "example",
"kind": "example",
"code": "example",
"answer": "example",
"discard_reason": "example"
}
]
},
"engagement": {
"link": "example",
"ip": "example",
"user_agent": "example",
"device": "example",
"platform": "example",
"referer": "example"
}
}

A chave não foi enviada, ou venceu.

Media typeapplication/json
object
error
string
Examplegenerated
{
"error": "example"
}

A mensagem não existe ou é de outra conta — respondemos igual nos dois casos, de propósito: um 403 confirmaria que o identificador existe.

Media typeapplication/json
object
error
string
Examplegenerated
{
"error": "example"
}