iGRPIGRP 3.0Documentation

Templates

Criar, publicar, arquivar e pré-visualizar templates.

Listar templates

GET
/api/v1/templates

Permissão: igrp.notification.admin. Filtros code, channel, status e locale. Para encontrar um template publicado por código, filtra com code e status=PUBLISHED.

Autorização

bearer-jwt
headerAutorizaçãoBearer <token>

Token do Access Management. Os envios são M2M (client_credentials); a inbox usa o token do utilizador.

Parâmetros de query

code?string
channel?string
Valor em"EMAIL""SMS""WHATSAPP""PUSH""IN_APP""OFFLINE"
status?string
Valor em"DRAFT""PUBLISHED""ARCHIVED"
locale?string
applicationCode?string
pageable*

Corpo da resposta

OK

*/*
  1. response
content?array<>
page?integer
Formatoint32
size?integer
Formatoint32
totalElements?integer
Formatoint64
totalPages?integer
Formatoint32
curl -X GET 'http://localhost:2575/gateway-api/igrp-notification-service/api/v1/templates?page=0&size=1&sort=string'
{  "content": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "code": "string",      "applicationCode": "string",      "channel": "EMAIL",      "locale": "string",      "version": 0,      "status": "string",      "subject": "string",      "body": "string",      "title": "string",      "variables": [        {          "name": "string",          "type": "STRING",          "required": true,          "example": "string"        }      ]    }  ],  "page": 0,  "size": 0,  "totalElements": 0,  "totalPages": 0}

Criar template (rascunho)

POST
/api/v1/templates

Permissão: igrp.notification.admin.

Autorização

bearer-jwt
headerAutorizaçãoBearer <token>

Token do Access Management. Os envios são M2M (client_credentials); a inbox usa o token do utilizador.

Corpo do pedido

application/json
  1. body
code*string
Comprimento1 <= length
channel*string
Valor em"EMAIL""SMS""WHATSAPP""PUSH""IN_APP""OFFLINE"
locale?string
subject?string
body?string
title?string
variables?array<>
applicationCode?string

Corpo da resposta

OK

*/*
  1. response
id?string
Formatouuid
code?string
applicationCode?string
channel?string
Valor em"EMAIL""SMS""WHATSAPP""PUSH""IN_APP""OFFLINE"
locale?string
version?integer
Formatoint32
status?string
subject?string
body?string
title?string
variables?array<>
curl -X POST 'http://localhost:2575/gateway-api/igrp-notification-service/api/v1/templates' \  -H 'Content-Type: application/json' \  -d '{  "code": "string",  "channel": "EMAIL"}'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "code": "string",  "applicationCode": "string",  "channel": "EMAIL",  "locale": "string",  "version": 0,  "status": "string",  "subject": "string",  "body": "string",  "title": "string",  "variables": [    {      "name": "string",      "type": "STRING",      "required": true,      "example": "string"    }  ]}

Obter template

GET
/api/v1/templates/{id}

Permissão: igrp.notification.admin.

Autorização

bearer-jwt
headerAutorizaçãoBearer <token>

Token do Access Management. Os envios são M2M (client_credentials); a inbox usa o token do utilizador.

Parâmetros de caminho

id*string
Formatouuid

Parâmetros de query

applicationCode?string

Corpo da resposta

OK

*/*
  1. response
id?string
Formatouuid
code?string
applicationCode?string
channel?string
Valor em"EMAIL""SMS""WHATSAPP""PUSH""IN_APP""OFFLINE"
locale?string
version?integer
Formatoint32
status?string
subject?string
body?string
title?string
variables?array<>
curl -X GET 'http://localhost:2575/gateway-api/igrp-notification-service/api/v1/templates/497f6eca-6276-4993-bfeb-53cbbbba6f08'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "code": "string",  "applicationCode": "string",  "channel": "EMAIL",  "locale": "string",  "version": 0,  "status": "string",  "subject": "string",  "body": "string",  "title": "string",  "variables": [    {      "name": "string",      "type": "STRING",      "required": true,      "example": "string"    }  ]}

Atualizar template

PUT
/api/v1/templates/{id}

Permissão: igrp.notification.admin.

Autorização

bearer-jwt
headerAutorizaçãoBearer <token>

Token do Access Management. Os envios são M2M (client_credentials); a inbox usa o token do utilizador.

Parâmetros de caminho

id*string
Formatouuid

Corpo do pedido

application/json
  1. body
subject?string
body?string
title?string
variables?array<>
applicationCode?string

Corpo da resposta

OK

*/*
  1. response
id?string
Formatouuid
code?string
applicationCode?string
channel?string
Valor em"EMAIL""SMS""WHATSAPP""PUSH""IN_APP""OFFLINE"
locale?string
version?integer
Formatoint32
status?string
subject?string
body?string
title?string
variables?array<>
curl -X PUT 'http://localhost:2575/gateway-api/igrp-notification-service/api/v1/templates/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/json' \  -d '{}'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "code": "string",  "applicationCode": "string",  "channel": "EMAIL",  "locale": "string",  "version": 0,  "status": "string",  "subject": "string",  "body": "string",  "title": "string",  "variables": [    {      "name": "string",      "type": "STRING",      "required": true,      "example": "string"    }  ]}

Publicar template

POST
/api/v1/templates/{id}/publish

Permissão: igrp.notification.admin.

Autorização

bearer-jwt
headerAutorizaçãoBearer <token>

Token do Access Management. Os envios são M2M (client_credentials); a inbox usa o token do utilizador.

Parâmetros de caminho

id*string
Formatouuid

Parâmetros de query

applicationCode?string

Corpo da resposta

OK

*/*
  1. response
id?string
Formatouuid
code?string
applicationCode?string
channel?string
Valor em"EMAIL""SMS""WHATSAPP""PUSH""IN_APP""OFFLINE"
locale?string
version?integer
Formatoint32
status?string
subject?string
body?string
title?string
variables?array<>
curl -X POST 'http://localhost:2575/gateway-api/igrp-notification-service/api/v1/templates/497f6eca-6276-4993-bfeb-53cbbbba6f08/publish'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "code": "string",  "applicationCode": "string",  "channel": "EMAIL",  "locale": "string",  "version": 0,  "status": "string",  "subject": "string",  "body": "string",  "title": "string",  "variables": [    {      "name": "string",      "type": "STRING",      "required": true,      "example": "string"    }  ]}

Arquivar template

POST
/api/v1/templates/{id}/archive

Permissão: igrp.notification.admin.

Autorização

bearer-jwt
headerAutorizaçãoBearer <token>

Token do Access Management. Os envios são M2M (client_credentials); a inbox usa o token do utilizador.

Parâmetros de caminho

id*string
Formatouuid

Parâmetros de query

applicationCode?string

Corpo da resposta

OK

*/*
  1. response
id?string
Formatouuid
code?string
applicationCode?string
channel?string
Valor em"EMAIL""SMS""WHATSAPP""PUSH""IN_APP""OFFLINE"
locale?string
version?integer
Formatoint32
status?string
subject?string
body?string
title?string
variables?array<>
curl -X POST 'http://localhost:2575/gateway-api/igrp-notification-service/api/v1/templates/497f6eca-6276-4993-bfeb-53cbbbba6f08/archive'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "code": "string",  "applicationCode": "string",  "channel": "EMAIL",  "locale": "string",  "version": 0,  "status": "string",  "subject": "string",  "body": "string",  "title": "string",  "variables": [    {      "name": "string",      "type": "STRING",      "required": true,      "example": "string"    }  ]}

Pré-visualizar template

POST
/api/v1/templates/{id}/preview

Permissão: igrp.notification.admin. Renderiza com variáveis de teste.

Autorização

bearer-jwt
headerAutorizaçãoBearer <token>

Token do Access Management. Os envios são M2M (client_credentials); a inbox usa o token do utilizador.

Parâmetros de caminho

id*string
Formatouuid

Parâmetros de query

applicationCode?string

Corpo do pedido

application/json
  1. body
variables?

Corpo da resposta

OK

*/*
  1. response
subject?string
body?string
title?string
curl -X POST 'http://localhost:2575/gateway-api/igrp-notification-service/api/v1/templates/497f6eca-6276-4993-bfeb-53cbbbba6f08/preview' \  -H 'Content-Type: application/json' \  -d '{}'
{  "subject": "string",  "body": "string",  "title": "string"}
How is this guide?

Última atualização: