# Datos históricos de eventos del equipo - historyGetEvents

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

Este método permite consultar los datos históricos de los eventos de un equipo para un rango de fechas y horas especificados.

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

<div><table class="table" style="width: 876px;"><tbody><tr><th style="width: 113px;">Parámetros</th><th style="width: 349px;">Descripción</th><th style="width: 93px;">Longitud</th><th style="width: 321px;">Ejemplo</th></tr><tr><td style="width: 113px;">apikey</td><td style="width: 349px;">Llave de autorización para uso de los Servicios Web.</td><td style="width: 93px;"><span role="presentation" style="padding-right: 0.1px;"><span style="color: #3366ff;">50</span></span></td><td style="width: 321px;"><span role="presentation" style="padding-right: 0.1px; color: #3366ff;">25sdsd234234aa93sdsdsd37c70118e72</span></td></tr><tr><td style="width: 113px;">token</td><td style="width: 349px;">Token devuelto por el método [**getToken**](https://docs.redgps.com/books/webservice/page/metodo-de-autenticacion-gettoken-7ef).</td><td style="width: 93px;"><span role="presentation" style="padding-right: 0.1px;"><span style="color: #3366ff;">500</span></span></td><td style="width: 321px;"><span role="presentation" style="padding-right: 0.1px; color: #3366ff;">wfszR/oPIQKjt5HT5NgjDnZ2SAZQ==</span></td></tr><tr><td style="width: 113px;">equipo</td><td style="width: 349px;">IMEI o Identificador único del dispositivo configurado en la plataforma.

</td><td style="width: 93px;"><span role="presentation" style="padding-right: 0.1px;"><span style="color: #3366ff;">200</span></span>

</td><td style="width: 321px;"><span role="presentation" style="padding-right: 0.1px;"><span style="color: #3366ff;">0580012342332337</span></span></td></tr><tr><td style="width: 113px;">fechaIni

</td><td style="width: 349px;">Fecha Inicial de los datos.</td><td style="width: 93px;"><span role="presentation" style="padding-right: 0.1px;"><span style="color: #3366ff;">19</span></span></td><td style="width: 321px;"><span role="presentation" style="padding-right: 0.1px;"><span style="color: #3366ff;">2021-04-27 00:00:00</span></span></td></tr><tr><td style="width: 113px;">fechaFin

</td><td style="width: 349px;">Fecha Final de los datos.

</td><td style="width: 93px;"><span role="presentation" style="padding-right: 0.1px;"><span style="color: #3366ff;">19</span></span>

</td><td style="width: 321px;"><span role="presentation" style="padding-right: 0.1px;"><span style="color: #3366ff;">2021-04-27 23:59:59</span></span></td></tr><tr><td style="width: 113px;">format

</td><td style="width: 349px;">Si se pasan horas en **fechaIni** y **fechaFin** debe enviar “**DateTime**”, de lo contrario utilice “**Date**”.

</td><td style="width: 93px;"><span role="presentation" style="padding-right: 0.1px;"><span style="color: #3366ff;">8</span></span>

</td><td style="width: 321px;"><span role="presentation" style="padding-right: 0.1px;"><span style="color: #3366ff;">DateTime</span></span></td></tr><tr><td style="width: 113px;">idsEvents

</td><td style="width: 349px;">Se específica un o muchos Id de los eventos a consultar, separados por coma sin espacios. Si no se especifican se obtienen todos los eventos que no sean ubicación.

</td><td style="width: 93px;"></td><td style="width: 321px;"><span style="color: #3366ff;">1321,1322,1323,1324,1325,1326,1336,  
1337,1338,1339</span></td></tr></tbody></table>

</div></details>##### Solicitud de ejemplo:

```shell
curl --location --request POST 'https://api.service24gps.com/api/v1/historygetevents' \
--form 'apikey="25sdsd234234aa93sdsdsd37c70118e72"' \
--form 'token="wfszR/oPIQKjt5HT5NgjDnZ2SAZQ=="' \
--form 'equipo="0580012342332337"' \
--form 'fechaIni="2021-04-27 00:00:00"' \
--form 'fechaFin="2021-04-27 23:59:59"' \
--form 'format="DateTime"' \
--form 'idsEvents="1321,1322,1323,1324,1325,1326,1336,1337,1338,1339"'
```

```JSON
{
	"status": 200,
	"data": {
            "equipo": "0580012342332337",
            "latitud": "19.528530",
            "longitud": "--99.171165",
            "idstatus": "1",
            "gmt": "-6",
            "fecha": "2024-01-04",
            "hora": "10:14:18",
            "fecha_reporte": "20240104101418",
            "idevento": "348",
            "velocidad": "0",
            "orientacion": "0",
            "senal": "0",
            "satelites": "0",
            "inputs": "0|0|0|0|0|0|0|0|0|0|0|0|0|0|0",
            "odometro": "0",
            "bateria_gps": "86",
            "bateria_veh": "0",
            "ignicion": "1",
            "idconductor": "34110",
            "domicilio": "Camino a San Juan Ixtacala 479, San Juan, Gustavo A. Madero, Mexico City, Mexico",
            "de_buffer": "0",
            "datos_extras": "{\"parameters\":{\"out_1\":\"0\",\"out_2\":\"0\",\"out_3\":\"0\",\"out_4\":\"0\",\"out_5\":\"0\",\"out_6\":\"0\",\"out_7\":\"0\",\"out_8\":\"0\"},\"outputs\":\"0|0|0|0|0|0|0|0\",\"Time_stamp_insert\":\"20210427201542\",\"tipo_dato\":{\"1\":\"2021-04-28 01:15:42\",\"13\":\"2021-04-27 21:04:29\",\"55\":\"2021-04-27 21:04:30\",\"14\":\"2021-04-27 21:05:42\",\"3\":\"2021-04-27 21:03:42\"},\"gw\":\"Escuchar-ST4340-TCP.php\",\"ip\":\"107.170.254.11\",\"kp\":\"6088b73e3a7f5\"}",
            "grupo": "CONDUCTORES MX",
            "conductor": "CONDUCTOR1",
            "patente": "ABC123",
            "activo": "ACTIVO 1"
	}
}


```

##### Respuesta de ejemplo:

<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: 809px; height: 1559px;"><tbody><tr style="height: 47px;"><th style="width: 210.99px; height: 47px;">Campo</th><th style="width: 366.997px; height: 47px;">Descripción

</th><th style="width: 230.99px; height: 47px;">Formato</th></tr><tr style="height: 69px;"><td style="width: 210.99px; height: 69px;">equipo

</td><td style="width: 366.997px; height: 69px;">Número de serie o IMEI que permite identificar el dispositivo.

</td><td style="width: 230.99px; height: 69px;">Entero

</td></tr><tr style="height: 47px;"><td style="width: 210.99px; height: 47px;">latitud

</td><td style="width: 366.997px; height: 47px;">Latitud de la posición del vehículo.

</td><td style="width: 230.99px; height: 47px;">Grados decimales

</td></tr><tr style="height: 47px;"><td style="width: 210.99px; height: 47px;">longitud

</td><td style="width: 366.997px; height: 47px;">Longitud de la posición del vehículo.

</td><td style="width: 230.99px; height: 47px;">Grados decimales

</td></tr><tr style="height: 92px;"><td style="width: 210.99px; height: 92px;">idstatus

</td><td style="width: 366.997px; height: 92px;">Status de la información que reportó el equipo:

1 = Información actual

2 = Información a futuro.

</td><td style="width: 230.99px; height: 92px;">Entero

</td></tr><tr style="height: 47px;"><td style="width: 210.99px; height: 47px;">gmt

</td><td style="width: 366.997px; height: 47px;">Greenwich Mean Time.

</td><td style="width: 230.99px; height: 47px;">Cadena de texto

</td></tr><tr style="height: 47px;"><td style="width: 210.99px; height: 47px;">fecha

</td><td style="width: 366.997px; height: 47px;">Fecha de la posición del vehículo.

</td><td style="width: 230.99px; height: 47px;">DateTime

</td></tr><tr style="height: 47px;"><td style="width: 210.99px; height: 47px;">hora

</td><td style="width: 366.997px; height: 47px;">Hora de la posición del vehículo.

</td><td style="width: 230.99px; height: 47px;">HH::MM:SS

</td></tr><tr style="height: 47px;"><td style="width: 210.99px; height: 47px;">fecha\_reporte

</td><td style="width: 366.997px; height: 47px;">Fecha y hora de la posición del vehículo.

</td><td style="width: 230.99px; height: 47px;">Timestamp

</td></tr><tr style="height: 47px;"><td style="width: 210.99px; height: 47px;">idevento

</td><td style="width: 366.997px; height: 47px;">Identificador del evento que reportó el equipo GPS.

</td><td style="width: 230.99px; height: 47px;">Entero

</td></tr><tr style="height: 47px;"><td style="width: 210.99px; height: 47px;">velocidad

</td><td style="width: 366.997px; height: 47px;">Velocidad en km/h que detecta el equipo GPS.

</td><td style="width: 230.99px; height: 47px;">Entero

</td></tr><tr style="height: 69px;"><td style="width: 210.99px; height: 69px;">orientacion

</td><td style="width: 366.997px; height: 69px;">Orientación en grados en la que reportó el equipo GPS.

</td><td style="width: 230.99px; height: 69px;">Entero

</td></tr><tr style="height: 47px;"><td style="width: 210.99px; height: 47px;">senal

</td><td style="width: 366.997px; height: 47px;">Señal GSM del equipo GPS.

</td><td style="width: 230.99px; height: 47px;">Entero

</td></tr><tr style="height: 47px;"><td style="width: 210.99px; height: 47px;">satelites

</td><td style="width: 366.997px; height: 47px;">Cantidad de satélites.

</td><td style="width: 230.99px; height: 47px;">Entero

</td></tr><tr style="height: 92px;"><td style="width: 210.99px; height: 92px;">inputs

</td><td style="width: 366.997px; height: 92px;">Estados de cada entrada del equipo:

0 = Desactivada

1 = Activada

</td><td style="width: 230.99px; height: 92px;">Cadena de texto

</td></tr><tr style="height: 69px;"><td style="width: 210.99px; height: 69px;">odometro

</td><td style="width: 366.997px; height: 69px;">Metros (mts) que ha recorrido el vehículo, detectado por el GPS.

</td><td style="width: 230.99px; height: 69px;">Entero

</td></tr><tr style="height: 69px;"><td style="width: 210.99px; height: 69px;">bateria\_gps

</td><td style="width: 366.997px; height: 69px;">Porcentaje o voltaje del nivel de la batería interna del GPS.

</td><td style="width: 230.99px; height: 69px;">Entero | Decimales

</td></tr><tr style="height: 47px;"><td style="width: 210.99px; height: 47px;">bateria\_veh

</td><td style="width: 366.997px; height: 47px;">Voltaje (v) de la batería del vehículo.

</td><td style="width: 230.99px; height: 47px;">Decimales

</td></tr><tr style="height: 114px;"><td style="width: 210.99px; height: 114px;">ignicion

</td><td style="width: 366.997px; height: 114px;">Status Ignición:

0 = OFF

1 = ON

2 = Desconocida

</td><td style="width: 230.99px; height: 114px;">Entero

</td></tr><tr style="height: 47px;"><td style="width: 210.99px; height: 47px;">IdConductor

</td><td style="width: 366.997px; height: 47px;">Id del conductor autentificado, Ibutton

</td><td style="width: 230.99px; height: 47px;">Entero

</td></tr><tr style="height: 47px;"><td style="width: 210.99px; height: 47px;">domicilio

</td><td style="width: 366.997px; height: 47px;">Domicilio.

</td><td style="width: 230.99px; height: 47px;">Cadena de texto

</td></tr><tr style="height: 92px;"><td style="width: 210.99px; height: 92px;">de\_buffer

</td><td style="width: 366.997px; height: 92px;">Status del tipo de reporte:

0 = Sin Buffer

1 = Buffer

</td><td style="width: 230.99px; height: 92px;">Entero

</td></tr><tr style="height: 47px;"><td style="width: 210.99px; height: 47px;">datos\_extras

</td><td style="width: 366.997px; height: 47px;">Valores que son obtenidos del protocolo OBDII.

</td><td style="width: 230.99px; height: 47px;">JSON

</td></tr><tr style="height: 47px;"><td style="width: 210.99px; height: 47px;">grupo

</td><td style="width: 366.997px; height: 47px;">Nombre del grupo que pertenece.

</td><td style="width: 230.99px; height: 47px;">Cadena de texto

</td></tr><tr style="height: 47px;"><td style="width: 210.99px; height: 47px;">conductor

</td><td style="width: 366.997px; height: 47px;">Nombre del conductor.

</td><td style="width: 230.99px; height: 47px;">Cadena de texto

</td></tr><tr style="height: 47px;"><td style="width: 210.99px; height: 47px;">patente

</td><td style="width: 366.997px; height: 47px;">Nombre de la patente.

</td><td style="width: 230.99px; height: 47px;">Cadena de texto

</td></tr><tr style="height: 47px;"><td style="width: 210.99px; height: 47px;">activo

</td><td style="width: 366.997px; height: 47px;">Nombre del activo.

</td><td style="width: 230.99px; height: 47px;">Cadena de texto

</td></tr></tbody></table>

</div></details>