{
  "info": {
    "name": "Mellon Connect API",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{credential}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://admin.mellonconnect.com"
    },
    {
      "key": "credential",
      "value": "dck_test_…"
    }
  ],
  "item": [
    {
      "name": "E-mail",
      "item": [
        {
          "name": "Enviar um e-mail transacional",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/email/deliveries",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "email",
                "deliveries"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"senderId\": \"ID_DO_REMETENTE\",\n  \"templateId\": \"ID_DO_MODELO\",\n  \"recipient\": \"cliente@exemplo.com\",\n  \"context\": {\n    \"nome\": \"Maria\"\n  }\n}"
            }
          }
        },
        {
          "name": "Estado de um envio",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/email/deliveries/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "email",
                "deliveries",
                ":id"
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Modelos",
      "item": [
        {
          "name": "Listar modelos",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/templates",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "templates"
              ]
            }
          }
        },
        {
          "name": "Criar um modelo de e-mail",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/templates",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "templates"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"subject\": \"Olá {nome}\",\n  \"content\": \"O seu pedido foi confirmado, {nome}.\",\n  \"variables\": [\n    \"nome\"\n  ]\n}"
            }
          }
        },
        {
          "name": "Ativar ou desativar um modelo",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/templates/:id/status",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "templates",
                ":id",
                "status"
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Códigos de verificação",
      "item": [
        {
          "name": "Gerar e enviar um código",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/verify/verifications",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "verify",
                "verifications"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"channel\": \"WHATSAPP\",\n  \"recipient\": \"+5511999999999\",\n  \"purpose\": \"login\"\n}"
            }
          }
        },
        {
          "name": "Estado de uma verificação",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/verify/verifications/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "verify",
                "verifications",
                ":id"
              ]
            }
          }
        },
        {
          "name": "Validar o código digitado",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/verify/verifications/:id/check",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "verify",
                "verifications",
                ":id",
                "check"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"code\": \"123456\"\n}"
            }
          }
        },
        {
          "name": "Reenviar o código",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/verify/verifications/:id/resend",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "verify",
                "verifications",
                ":id",
                "resend"
              ]
            }
          }
        },
        {
          "name": "Cancelar a verificação",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/verify/verifications/:id/cancel",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "verify",
                "verifications",
                ":id",
                "cancel"
              ]
            }
          }
        },
        {
          "name": "Enviar um código gerado pelo seu sistema",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/verify/deliveries",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "verify",
                "deliveries"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"channel\": \"SMS\",\n  \"recipient\": \"+5511999999999\",\n  \"purpose\": \"login\",\n  \"mode\": \"CUSTOM\",\n  \"code\": \"482913\"\n}"
            }
          }
        }
      ]
    },
    {
      "name": "SMS",
      "item": [
        {
          "name": "Enviar um SMS",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/sms/messages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "sms",
                "messages"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"to\": \"+5511999999999\",\n  \"country\": \"BR\",\n  \"template\": \"cobranca_lembrete\",\n  \"variables\": {\n    \"nome\": \"Maria\",\n    \"valor\": \"R$ 120,00\"\n  }\n}"
            }
          }
        },
        {
          "name": "Estado de um SMS",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/sms/messages/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "sms",
                "messages",
                ":id"
              ]
            }
          }
        }
      ]
    },
    {
      "name": "WhatsApp",
      "item": [
        {
          "name": "Enviar uma mensagem",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/whatsapp/messages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "whatsapp",
                "messages"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"to\": \"5511999999999\",\n  \"type\": \"text\",\n  \"text\": \"Olá!\"\n}"
            }
          }
        },
        {
          "name": "Templates aprovados do número",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/whatsapp/templates",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "whatsapp",
                "templates"
              ]
            }
          }
        },
        {
          "name": "Eventos recebidos (mensagens e estados)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/whatsapp/events",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "whatsapp",
                "events"
              ]
            }
          }
        },
        {
          "name": "Estado da conexão WhatsApp",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/whatsapp/status",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "whatsapp",
                "status"
              ]
            }
          }
        }
      ]
    }
  ]
}