> For the complete documentation index, see [llms.txt](https://i2solutions.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://i2solutions.gitbook.io/docs/api-web/api.novedades.md).

# Novedades

## Crear novedad

**POST** **/api/web/novedades**

### Body:

| Name        | Type   | Desc                    |
| ----------- | ------ | ----------------------- |
| descripcion | string | minLength: 2            |
| prioridad   | string | 'alta', 'media', 'baja' |
| fotoUrl     | string | url                     |
| fecha       | fecha  | ---                     |
| puestosId   | Number | ---                     |

### Response:

```javascript
{
  "estado": true,
  "datos": {
    "fecha": "2011-10-01T05:00:00.000Z",
    "fotoUrl": "",
    "fueAtendida": false,
    "id": 1,
    "descripcion": "INCREMENTO DE LAS ANOMALÍAS VISUALES, FATIGA MENTAL Y VISUAL, DOLOR DE CABEZA",
    "prioridad": "media",
    "puestosId": 1,
    "fechaActualizacion": "2011-10-01T05:00:00.000Z",
    "fechaCreacion": "2011-10-01T05:00:00.000Z"
  },
  "codigoEstado": 200
}
```

## Actualizar novedad

**PUT** **/api/web/novedades/:novedadesId**

### Params:

| Name        | Type   | Desc |
| ----------- | ------ | ---- |
| novedadesId | Number | ---  |

### Body:

| Name        | Type   | Desc                    |
| ----------- | ------ | ----------------------- |
| descripcion | string | minLength: 2            |
| prioridad   | string | 'alta', 'media', 'baja' |
| fotoUrl     | string | url                     |
| fecha       | fecha  | ---                     |
| puestosId   | Number | ---                     |

### Request:

```javascript
{
  "descripcion": "aa",
  "prioridad": "media",
  "fecha": "2014-05-21T19:27:28.576Z",
  "fotoUrl": "https://imagen.png",
  "puestosId": 1
}
```

### Response:

```javascript
{
  "estado": true,
  "datos": true,
  "codigoEstado": 200
}
```

## Eliminar novedad

**DELETE** **/api/web/novedades/:novedadesId**

### Params:

| Name        | Type   | Desc |
| ----------- | ------ | ---- |
| novedadesId | Number | ---  |

### Response:

```javascript
{
  "estado": true,
  "datos": true,
  "codigoEstado": 200
}
```

## Obtener un novedad

**GET** **/api/web/novedades/:novedadesId**

### Params:

| Name        | Type   | Desc |
| ----------- | ------ | ---- |
| novedadesId | Number | ---  |

### Response:

```javascript
{
  "estado": true,
  "datos": {
    "id": 1,
    "descripcion": "INCREMENTO DE LAS ANOMALÍAS VISUALES, FATIGA MENTAL Y VISUAL, DOLOR DE CABEZA",
    "descripcionAtendida": null,
    "prioridad": "media",
    "fecha": "2011-10-01 05:00:00.000 +00:00",
    "fotoUrl": "https://imagen.png",
    "fueAtendida": "0",
    "fechaCreacion": "2011-10-01 05:00:00.000 +00:00",
    "fechaActualizacion": "2011-10-01 05:00:00.000 +00:00",
    "puestosId": 1,
    "inspeccionesId": null
  },
  "codigoEstado": 200
}
```

## Obtener novedades por establecimiento

**GET** **/api/web/novedades/establecimientos/:establecimientosId**

### Params:

| Name               | Type   | Desc |
| ------------------ | ------ | ---- |
| establecimientosId | Number | ---  |

### Response:

```javascript
{
  "estado": true,
  "datos": {
    "novedadesAtendidas": [
      {
        "id": 1,
        "descripcion": "INCREMENTO DE LAS ANOMALÍAS VISUALES, FATIGA MENTAL Y VISUAL, DOLOR DE CABEZA",
        "prioridad": "media",
        "fecha": "2011-10-01 05:00:00.000 +00:00",
        "fotoUrl": "https://imagen.png",
        "fueAtendida": "1",
        "puestosId": 1,
        "areasId": 1,
        "areasActividad": "gerencia",
        "areasNombre": "Gerente General",
        "areasDescripcionLugar": "Neque incidunt earum quia sint dolorem dolores ut amet.",
        "puestosNombre": "Oficina de gerente general"
      }
    ],
    "novedadesNoAtendidas": [
      {
        "id": 2,
        "descripcion": "INCREMENTO DE LAS ANOMALÍAS VISUALES, FATIGA MENTAL Y VISUAL",
        "prioridad": "baja",
        "fecha": "2011-10-01 05:00:00.000 +00:00",
        "fotoUrl": "https://imagen.png",
        "fueAtendida": "0",
        "puestosId": 1,
        "areasId": 1,
        "areasActividad": "gerencia",
        "areasNombre": "Gerente General",
        "areasDescripcionLugar": "Neque incidunt earum quia sint dolorem dolores ut amet.",
        "puestosNombre": "Oficina de gerente general"
      }
    ]
  },
  "codigoEstado": 200
}
```

## Obtener novedades por area

**GET** **/api/web/novedades/areas/:areasId**

### Params:

| Name    | Type   | Desc |
| ------- | ------ | ---- |
| areasId | Number | ---  |

### Response:

```javascript
{
  "estado": true,
  "datos": {
    "novedadesAtendidas": [
      {
        "id": 1,
        "descripcion": "INCREMENTO DE LAS ANOMALÍAS VISUALES, FATIGA MENTAL Y VISUAL, DOLOR DE CABEZA",
        "prioridad": "media",
        "fecha": "2011-10-01 05:00:00.000 +00:00",
        "fotoUrl": "https://imagen.png",
        "fueAtendida": "1",
        "puestosId": 1,
        "puestosNombre": "Oficina de gerente general"
      }
    ],
    "novedadesNoAtendidas": [
      {
        "id": 2,
        "descripcion": "INCREMENTO DE LAS ANOMALÍAS VISUALES, FATIGA MENTAL Y VISUAL",
        "prioridad": "baja",
        "fecha": "2011-10-01 05:00:00.000 +00:00",
        "fotoUrl": "https://imagen.png",
        "fueAtendida": "0",
        "puestosId": 1,
        "puestosNombre": "Oficina de gerente general"
      }
    ]
  },
  "codigoEstado": 200
}
```

## Obtener novedades por puesto

**GET** **/api/web/novedades/puestos/:puestosId**

### Params:

| Name      | Type   | Desc |
| --------- | ------ | ---- |
| puestosId | Number | ---  |

### Response:

```javascript
{
  "estado": true,
  "datos": {
    "novedadesAtendidas": [
      {
        "id": 1,
        "descripcion": "INCREMENTO DE LAS ANOMALÍAS VISUALES, FATIGA MENTAL Y VISUAL, DOLOR DE CABEZA",
        "prioridad": "media",
        "fecha": "2011-10-01 05:00:00.000 +00:00",
        "fotoUrl": "https://imagen.png",
        "fueAtendida": "1",
        "puestosId": 1
      }
    ],
    "novedadesNoAtendidas": [
      {
        "id": 2,
        "descripcion": "INCREMENTO DE LAS ANOMALÍAS VISUALES, FATIGA MENTAL Y VISUAL",
        "prioridad": "baja",
        "fecha": "2011-10-01 05:00:00.000 +00:00",
        "fotoUrl": "https://imagen.png",
        "fueAtendida": "0",
        "puestosId": 1
      }
    ]
  },
  "codigoEstado": 200
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://i2solutions.gitbook.io/docs/api-web/api.novedades.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
