Plantillas de Summit Notify
Una plantilla guarda asunto, cuerpo y tipo de contenido. Todos sus endpoints requieren un access token OpenID Connect.
Esta página describe plantillas de correo. Las plantillas aprobadas por Meta tienen un contrato y endpoints distintos; consulta Canal WhatsApp.
Endpoints
Sección titulada «Endpoints»| Método | Ruta | Éxito |
|---|---|---|
GET |
/api/v1/templates |
200 OK |
POST |
/api/v1/templates |
201 Created |
GET |
/api/v1/templates/{id} |
200 OK |
PUT |
/api/v1/templates/{id} |
200 OK |
DELETE |
/api/v1/templates/{id} |
204 No Content |
| Campo | Tipo | Requerido | Descripción |
|---|---|---|---|
name |
string | Sí | Nombre interno; no puede contener solo espacios. |
subject |
string | Sí | Go template del asunto. |
body |
string | Sí | Go template del cuerpo. |
body_type |
string | No | text por defecto o html. |
subject y body deben analizarse como Go text/template. La validación ocurre al crear y actualizar.
curl -X POST https://notify.summitexplorerjd.ec/api/v1/templates \ -H "Authorization: Bearer $OIDC_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Bienvenida", "subject": "Hola {{.Nombre}}, bienvenido", "body": "Gracias por registrarte, {{.Nombre}}.", "body_type": "text" }'Respuesta 201:
{ "id": "c7a4e210-9d2b-4f6a-8e1c-3b5d7f9a0c2e", "name": "Bienvenida", "subject": "Hola {{.Nombre}}, bienvenido", "body": "Gracias por registrarte, {{.Nombre}}.", "body_type": "text", "created_at": "2026-08-03T14:00:00Z", "updated_at": "2026-08-03T14:00:00Z"}Listar y obtener
Sección titulada «Listar y obtener»GET /api/v1/templates devuelve un arreglo sin paginación con el esquema anterior. Solo contiene plantillas del usuario autenticado.
GET /api/v1/templates/{id} devuelve una plantilla. Un ID inválido produce 400; uno inexistente o ajeno, 404.
Actualizar
Sección titulada «Actualizar»curl -X PUT https://notify.summitexplorerjd.ec/api/v1/templates/TEMPLATE_ID \ -H "Authorization: Bearer $OIDC_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Bienvenida actualizada", "subject": "Hola {{.Nombre}}", "body": "Ya puedes comenzar a utilizar tu cuenta.", "body_type": "html" }'PUT reemplaza los cuatro campos; no es un patch. Responde 200 con la plantilla actualizada.
Eliminar
Sección titulada «Eliminar»curl -X DELETE https://notify.summitexplorerjd.ec/api/v1/templates/TEMPLATE_ID \ -H "Authorization: Bearer $OIDC_ACCESS_TOKEN"Responde 204 sin body. Las notificaciones ya renderizadas conservan su asunto y cuerpo. Una solicitud nueva que use el ID eliminado recibe 400 template_id not found.
Renderizado en notificaciones
Sección titulada «Renderizado en notificaciones»{ "recipient": "destinatario@example.com", "template_id": "c7a4e210-9d2b-4f6a-8e1c-3b5d7f9a0c2e", "variables": { "Nombre": "Juan" }}- Las variables son un mapa de cadenas.
- Distinguen mayúsculas y minúsculas.
- Una variable ausente se convierte en
<no value>. template_idgana sobresubjectybodydirectos.body_typehereda la plantilla, salvo que la notificación envíetextohtmlexplícitamente.- La plantilla se renderiza antes de encolar; cambios posteriores no alteran la notificación creada.
Errores de validación
Sección titulada «Errores de validación»| Error | Condición |
|---|---|
name is required |
Nombre vacío o solo espacios. |
subject is required |
Asunto vacío. |
body is required |
Cuerpo vacío. |
body_type must be one of: text, html |
Tipo no soportado. |
subject/body is not a valid template |
Sintaxis Go template inválida. |
Todos producen 400 Bad Request.