iGRPIGRP 3.0Documentation

Notificações e lotes

Enviar, listar, reenviar, envios em massa e lotes.

Listar notificações

GET
/api/v1/notifications

Permissão: igrp.notification.read. Filtros por businessKey, category, priority, channel, status, batchId, recurrenceId, recipient e intervalo createdFrom/createdTo (ISO 8601).

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

businessKey?string
category?string
priority?string
Valor em"LOW""NORMAL""HIGH""URGENT"
channel?string
Valor em"EMAIL""SMS""WHATSAPP""PUSH""IN_APP""OFFLINE"
status?string
Valor em"PENDING""QUEUED""SENDING""SENT""DELIVERED""READ""FAILED""CANCELLED""EXPIRED"
batchId?string
Formatouuid
recurrenceId?string
Formatouuid
recipient?string
createdFrom?string
Formatodate-time
createdTo?string
Formatodate-time
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/notifications?page=0&size=1&sort=string'
{  "content": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "businessKey": "string",      "category": "string",      "priority": "string",      "channelStrategy": "string",      "createdAt": "2019-08-24T14:15:22Z",      "deliveryStats": {        "total": 0,        "pending": 0,        "queued": 0,        "sending": 0,        "sent": 0,        "delivered": 0,        "read": 0,        "failed": 0,        "cancelled": 0,        "expired": 0      }    }  ],  "page": 0,  "size": 0,  "totalElements": 0,  "totalPages": 0}

Enviar notificação

POST
/api/v1/notifications

Permissão: igrp.notification.send. Pedido M2M (token client_credentials). Responde 202 com o id e as entregas; a entrega é assíncrona. EMAIL exige o provider SMTP configurado (senão 422 CHANNEL_NOT_ENABLED).

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
businessKey?string
category?string
priority?string
Valor em"LOW""NORMAL""HIGH""URGENT"
channelStrategy*string
Valor em"SPECIFIC""ALL""PREFERRED"
channels?array<>
recipients?array<>
groups?array<>
template?
inline?
variables?
locale?string
attachments?array<>
idempotencyKey?string
correlationId?string
callbackUrl?string
scheduledAt?string
Formatodate-time
expiresAt?string
Formatodate-time
applicationCode?string

Corpo da resposta

OK

*/*
  1. response
id?string
Formatouuid
deliveries?array<>
curl -X POST 'http://localhost:2575/gateway-api/igrp-notification-service/api/v1/notifications' \  -H 'Content-Type: application/json' \  -d '{  "channelStrategy": "SPECIFIC"}'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "deliveries": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "channel": "string",      "status": "string",      "providerMessageId": "string",      "errorCode": "string",      "recipientUserId": "string",      "recipientEmail": "string",      "recipientPhone": "string"    }  ]}

Obter notificação

GET
/api/v1/notifications/{id}

Permissão: igrp.notification.read. Inclui as entregas e o conteúdo renderizado.

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
applicationCode?string
businessKey?string
category?string
priority?string
channelStrategy?string
channels?array<string>
templateCode?string
templateLocale?string
locale?string
scheduledAt?string
Formatodate-time
expiresAt?string
Formatodate-time
batchId?string
Formatouuid
recurrenceId?string
Formatouuid
resendOf?string
Formatouuid
idempotencyKey?string
correlationId?string
createdBy?string
createdAt?string
Formatodate-time
deliveries?array<>
curl -X GET 'http://localhost:2575/gateway-api/igrp-notification-service/api/v1/notifications/497f6eca-6276-4993-bfeb-53cbbbba6f08'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "applicationCode": "string",  "businessKey": "string",  "category": "string",  "priority": "string",  "channelStrategy": "string",  "channels": [    "string"  ],  "templateCode": "string",  "templateLocale": "string",  "locale": "string",  "scheduledAt": "2019-08-24T14:15:22Z",  "expiresAt": "2019-08-24T14:15:22Z",  "batchId": "5579c111-9c50-47e2-af92-f16d52e63189",  "recurrenceId": "6fa1ecb6-5547-4080-8b7c-c837a5472fe0",  "resendOf": "6a92c73a-ace4-45ff-b39d-5644ef85bd39",  "idempotencyKey": "string",  "correlationId": "string",  "createdBy": "string",  "createdAt": "2019-08-24T14:15:22Z",  "deliveries": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "channel": "string",      "status": "string",      "recipientUserId": "string",      "recipientEmail": "string",      "recipientPhone": "string",      "renderedSubject": "string",      "renderedBody": "string",      "renderedTitle": "string",      "attempts": 0,      "providerMessageId": "string",      "errorCode": "string",      "sentAt": "2019-08-24T14:15:22Z",      "deliveredAt": "2019-08-24T14:15:22Z",      "readAt": "2019-08-24T14:15:22Z",      "failedAt": "2019-08-24T14:15:22Z"    }  ]}

Reenviar notificação

POST
/api/v1/notifications/{id}/resend

Permissão: igrp.notification.send. Canais e destinatários opcionais.

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
channels?array<>
recipients?array<>
correlationId?string
applicationCode?string

Corpo da resposta

OK

*/*
  1. response
id?string
Formatouuid
deliveries?array<>
curl -X POST 'http://localhost:2575/gateway-api/igrp-notification-service/api/v1/notifications/497f6eca-6276-4993-bfeb-53cbbbba6f08/resend' \  -H 'Content-Type: application/json' \  -d '{}'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "deliveries": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "channel": "string",      "status": "string",      "providerMessageId": "string",      "errorCode": "string",      "recipientUserId": "string",      "recipientEmail": "string",      "recipientPhone": "string"    }  ]}

Envio em massa

POST
/api/v1/notifications/bulk

Permissão: igrp.notification.send. O mesmo pedido para muitos destinatários; devolve o batchId.

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
businessKey?string
category?string
priority?string
Valor em"LOW""NORMAL""HIGH""URGENT"
channelStrategy*string
Valor em"SPECIFIC""ALL""PREFERRED"
channels?array<>
recipients?array<>
groups?array<>
template?
inline?
variables?
locale?string
attachments?array<>
idempotencyKey?string
correlationId?string
callbackUrl?string
scheduledAt?string
Formatodate-time
expiresAt?string
Formatodate-time
applicationCode?string

Corpo da resposta

OK

*/*
  1. response
batchId?string
Formatouuid
notificationId?string
Formatouuid
totalDeliveries?integer
Formatoint32
deliveries?array<>
curl -X POST 'http://localhost:2575/gateway-api/igrp-notification-service/api/v1/notifications/bulk' \  -H 'Content-Type: application/json' \  -d '{  "channelStrategy": "SPECIFIC"}'
{  "batchId": "5579c111-9c50-47e2-af92-f16d52e63189",  "notificationId": "2d591c23-85b1-4e8c-a6bd-74d89f8955c5",  "totalDeliveries": 0,  "deliveries": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "channel": "string",      "status": "string",      "providerMessageId": "string",      "errorCode": "string",      "recipientUserId": "string",      "recipientEmail": "string",      "recipientPhone": "string"    }  ]}

Envio em massa por CSV

POST
/api/v1/notifications/bulk/csv

Permissão: igrp.notification.send. Multipart: parte request (JSON) e parte file (CSV).

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

multipart/form-data
  1. body
request*
file*file
Formatobinary

Corpo da resposta

OK

*/*
  1. response
batchId?string
Formatouuid
notificationId?string
Formatouuid
totalDeliveries?integer
Formatoint32
deliveries?array<>
curl -X POST 'http://localhost:2575/gateway-api/igrp-notification-service/api/v1/notifications/bulk/csv' \  -F 'request={  "channelStrategy": "SPECIFIC"}' \  -F 'file=string'
{  "batchId": "5579c111-9c50-47e2-af92-f16d52e63189",  "notificationId": "2d591c23-85b1-4e8c-a6bd-74d89f8955c5",  "totalDeliveries": 0,  "deliveries": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "channel": "string",      "status": "string",      "providerMessageId": "string",      "errorCode": "string",      "recipientUserId": "string",      "recipientEmail": "string",      "recipientPhone": "string"    }  ]}

Progresso do lote

GET
/api/v1/batches/{batchId}

Permissão: igrp.notification.read.

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

batchId*string
Formatouuid

Parâmetros de query

applicationCode?string

Corpo da resposta

OK

*/*
  1. response
batchId?string
Formatouuid
status?string
Valor em"ACCEPTED""CANCELLED"
total?integer
Formatoint64
sent?integer
Formatoint64
delivered?integer
Formatoint64
failed?integer
Formatoint64
cancelled?integer
Formatoint64
pending?integer
Formatoint64
curl -X GET 'http://localhost:2575/gateway-api/igrp-notification-service/api/v1/batches/497f6eca-6276-4993-bfeb-53cbbbba6f08'
{  "batchId": "5579c111-9c50-47e2-af92-f16d52e63189",  "status": "ACCEPTED",  "total": 0,  "sent": 0,  "delivered": 0,  "failed": 0,  "cancelled": 0,  "pending": 0}

Cancelar lote

POST
/api/v1/batches/{batchId}/cancel

Permissão: igrp.notification.send. Cancela as entregas ainda pendentes.

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

batchId*string
Formatouuid

Parâmetros de query

applicationCode?string

Corpo da resposta

OK

*/*
  1. response
batchId?string
Formatouuid
status?string
Valor em"ACCEPTED""CANCELLED"
total?integer
Formatoint64
sent?integer
Formatoint64
delivered?integer
Formatoint64
failed?integer
Formatoint64
cancelled?integer
Formatoint64
pending?integer
Formatoint64
curl -X POST 'http://localhost:2575/gateway-api/igrp-notification-service/api/v1/batches/497f6eca-6276-4993-bfeb-53cbbbba6f08/cancel'
{  "batchId": "5579c111-9c50-47e2-af92-f16d52e63189",  "status": "ACCEPTED",  "total": 0,  "sent": 0,  "delivered": 0,  "failed": 0,  "cancelled": 0,  "pending": 0}
How is this guide?

Última atualização: