POST
https://api.myidvirtual.com
/
warning
Criar Aviso
curl --request POST \
  --url https://api.myidvirtual.com/warning \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "<string>",
  "message": "<string>",
  "type": "<string>",
  "user": "<string>",
  "show": true,
  "priority": 123
}
'
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "title": "Manutenção Programada",
  "message": "Sistema em manutenção das 02:00 às 04:00",
  "type": "INFO",
  "show": true,
  "priority": 3,
  "createdAt": "2024-01-15T10:30:00.000Z"
}

Criar Aviso

Endpoint para criar avisos que serão exibidos no aplicativo.

Autenticação

Authorization
string
required
Bearer token JWT do usuário autenticado

Autorização

Request Body

title
string
required
Título do aviso
message
string
required
Mensagem do aviso
type
string
required
Tipo do aviso (INFO, WARNING, ERROR, SUCCESS)
user
string
required
ID do usuário criador do aviso
show
boolean
Exibir aviso. Padrão: true
priority
number
Prioridade de exibição (1-5)

Responses

{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "title": "Manutenção Programada",
  "message": "Sistema em manutenção das 02:00 às 04:00",
  "type": "INFO",
  "show": true,
  "priority": 3,
  "createdAt": "2024-01-15T10:30:00.000Z"
}

Exemplo de Requisição

curl --location --request POST 'http://localhost:3333/warning' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' \
--header 'Content-Type: application/json' \
--data-raw '{
  "title": "Manutenção Programada",
  "message": "Sistema em manutenção das 02:00 às 04:00",
  "type": "INFO",
  "user": "user-id-123",
  "show": true,
  "priority": 3
}'