# Obtener alertas por día - getAlerts

##### <span class="api-method" data-method="POST">POST</span> https://api.service24gps.com/api/v1/getAlerts

Obtiene las alertas generadas en el rango de fechas indicado para un equipo específico, un grupo de Activos o todos los equipos asociados al usuario.

<details class="mb-m" id="bkmrk-body-parametersparam"><summary class="text-muted">Ver parámetros de solicitud:</summary>

<table class="table" style="height: 437.531px; width: 810px;" width="804"><tbody><tr style="height: 75.375px;"><th style="width: 109.219px; height: 75.375px;">Parámetros</th><th style="width: 396.844px; height: 75.375px;">Descripción</th><th style="width: 302.938px; height: 75.375px;">Ejemplo</th></tr><tr style="height: 58.5938px;"><td style="width: 109.219px; height: 58.5938px;">apikey</td><td style="width: 396.844px; height: 58.5938px;">**(Requerido)** Llave de autorización para uso de los Servicios Web.</td><td style="width: 302.938px; height: 58.5938px;"><span role="presentation" style="padding-right: 0.1px; color: #3366ff;">25sdsd234234aa93sdsdsd37c70118e72</span></td></tr><tr style="height: 47.3906px;"><td style="width: 109.219px; height: 47.3906px;">token</td><td style="width: 396.844px; height: 47.3906px;">**(Requerido)** Token devuelto por el método [**getToken**](https://docs.redgps.com/books/webservice/page/metodo-de-autenticacion-gettoken/es).</td><td style="width: 302.938px; height: 47.3906px;"><span style="color: #3366ff;">wfszR/oPIQKjt5HT5NgjDnZ2SAZQ==</span> </td></tr><tr style="height: 80.9844px;"><td style="width: 109.219px; height: 80.9844px;">idgrupo</td><td style="width: 396.844px; height: 80.9844px;">**(Opcional)** Identificador único del grupo de Activos. Este parámetro tiene prioridad sobre **equipo;** si se especifica, la consulta se realizará para los Activos pertenecientes al grupo indicado. Para obtener los identificadores disponibles, consulte el método **[getAssetGroups.](https://docs.redgps.com/books/webservice/page/listado-de-grupo-de-activos-getassetgroups/es)**   
  
**Nota:** Si se desea realizar la consulta únicamente para un equipo, este parámetro debe enviarse vacío.   
</td><td style="width: 302.938px; height: 80.9844px;"><span style="color: #3366ff;">45665</span></td></tr><tr style="height: 75.3906px;"><td style="width: 109.219px; height: 75.3906px;">equipo</td><td style="width: 396.844px; height: 75.3906px;">**(Requerido)** IMEI del equipo del cual se desean obtener las alertas. Este parámetro será considerado únicamente cuando **idgrupo** no se especifique.  
</td><td style="width: 302.938px; height: 75.3906px;"><div><div><span style="color: #3366ff;">354148072188807</span></div></div></td></tr><tr style="height: 58px;"><td style="width: 109.219px; height: 58px;">fecha\_inicio</td><td style="width: 396.844px; height: 58px;">**(Requerido)** Fecha de inicio del rango para la consulta de alertas.</td><td style="width: 302.938px; height: 58px;"><div><div><span style="color: #3366ff;">2026-08-01</span></div></div></td></tr><tr style="height: 41.7969px;"><td style="width: 109.219px; height: 41.7969px;">fecha\_fin</td><td style="width: 396.844px; height: 41.7969px;">**(Requerido)** Fecha de fin del rango para la consulta de alertas.</td><td style="width: 302.938px; height: 41.7969px;"><div><div><span style="color: #3366ff;">2026-08-14</span></div></div></td></tr></tbody></table>

</details><p class="callout info">Si los parámetros **idgrupo** y **equipo** se envían vacíos, la consulta devolverá las alertas de todos los Activos asociados al usuario.</p>

<p class="callout info">Si ambos campos de fecha se dejan vacíos, la consulta se realizará para el día actual.</p>

<p class="callout info">Solo es posible consultar rangos de hasta **14 días**.</p>

##### Solicitud de ejemplo:

```shell
curl --location 'https://api.service24gps.com/api/v1/getAlerts' \
--form 'apikey="25sdsd234234aa93sdsdsd37c70118e72"' \
--form 'token="wfszR/oPIQKjt5HT5NgjDnZ2SAZQ=="' \
--form 'idgrupo="45665"' \
--form 'equipo="354148072188807"' \
--form 'fecha_inicio="2026-08-01"' \
--form 'fecha_fin="2026-08-14"'
```

##### Respuesta de ejemplo:

```JSON
{
	"status": 200,
	"data": {
    	"Equipo": "354148072188807",
        "Fecha": "2026-08-10",
      	"Hora": "08:16:16",
      	"Descripcion": "Unidad   Gener&oacute; BOTON DE PANICO el 2022/02/24 08:16:16<br /><br>",
        "Latitud": "18.98043888996881",
        "Longitud": "-98.22312211997996",
        "Domicilio": "Boulevard Perif&eacute;rico Ecol&oacute;gico, Constituci&oacute;n Loma Bella, 72474 Puebla, Puebla",
        "StatusAlerta": "FUERA DE LA GEOCERCA",
      	"TipoAlerta": "Geocerca E/S"
    }
}
```

<details class="mb-m" id="bkmrk-ver-par%C3%A1metros%3A-par%C3%A1"><summary class="text-muted">Ver campos de respuesta:</summary>

<div><table class="table" id="bkmrk-campo-descripci%C3%B3n-fo" style="width: 1052px; height: 339px;"><tbody><tr style="height: 46px;"><th style="width: 174px; height: 46px;">Campo</th><th style="width: 392px; height: 46px;">Descripción

</th><th style="width: 243px; height: 46px;">Formato</th><th style="width: 243px;"> </th></tr><tr style="height: 41px;"><td style="width: 174px; height: 41px;">Equipo</td><td style="width: 392px; height: 41px;">Equipo asignado al vehículo que ejecutó la alerta.</td><td style="width: 243px; height: 41px;">Cadena de Texto</td><td style="width: 243px;"> </td></tr><tr style="height: 41px;"><td style="width: 174px; height: 41px;">Fecha</td><td style="width: 392px; height: 41px;">Fecha en la que la alerta se ejecutó.</td><td style="width: 243px; height: 41px;">DateTime</td><td style="width: 243px;"> </td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">Hora</td><td style="width: 392px; height: 47px;">Hora de la alerta (se maneja en formato de 24 hrs.)

</td><td style="width: 243px; height: 47px;">DateTime</td><td style="width: 243px;"> </td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">Descripción

</td><td style="width: 392px; height: 47px;">Texto descriptivo de la alerta.

</td><td style="width: 243px; height: 47px;">Cadena de Texto</td><td style="width: 243px;"> </td></tr><tr style="height: 35px;"><td style="height: 35px; width: 174px;">Latitud

</td><td style="height: 35px; width: 392px;">Latitud correspondiente al punto en que se originó la alerta.

</td><td style="height: 35px; width: 243px;">Cadena de Texto

</td><td style="width: 243px;"></td></tr><tr style="height: 35px;"><td style="height: 35px; width: 174px;">Longitud

</td><td style="height: 35px; width: 392px;">Longitud correspondiente al punto en que se originó  
la alerta.

</td><td style="height: 35px; width: 243px;">Cadena de Texto

</td><td style="width: 243px;"></td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">Domicilio

</td><td style="width: 392px; height: 47px;">Dirección correspondiente a la latitud y longitud  
reportada por el equipo.

</td><td style="width: 243px; height: 47px;">Cadena de Texto

</td><td style="width: 243px;"></td></tr><tr><td style="width: 174px;">StatusAlerta

</td><td style="width: 392px;">Nombre del estado del alerta, puede ser los siguientes:

- IGNICIÓN ON
- IGNICIÓN OFF
- DENTRO DE LA GEOCERCA
- FUERA DE LA GEOCERCA
- TEMPERATURA LIMITE INFERIOR
- TEMPERATURA LIMITE SUPERIOR

</td><td style="width: 243px;">Cadena de Texto

</td><td style="width: 243px;"></td></tr><tr><td style="width: 174px;">TipoAlerta

</td><td style="width: 392px;">Nombre del tipo de alerta que se generó.

</td><td style="width: 243px;">Cadena de Texto

</td><td style="width: 243px;"></td></tr></tbody></table>

</div></details>