# Datos de unidades - getData

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

Este método devuelve un array de datos con la última información o reporte enviado por las unidades de rastreo asignadas al usuario autentificado.

<p class="callout danger">**IMPORTANTE:** No recomendamos utilizar este método para consultar de forma recurrente las posiciones de todos los Activos. Si necesitas recibir continuamente la información reportada por tus Activos en un sistema externo, utiliza un [Web Service genérico](https://docs.redgps.com/books/webservices-de-retransmision-de-datos/page/webservice-de-reenvio-generico/es).</p>

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

<div><table class="table" style="height: 367px; width: 853px;"><tbody><tr style="height: 41px;"><th style="width: 117px; height: 41px;">Parámetros</th><th style="width: 360px; height: 41px;">Descripción</th><th style="width: 88px;">Longitud</th><th style="width: 288px; height: 41px;">Ejemplo</th></tr><tr style="height: 57px;"><td style="width: 117px; height: 57px;">apikey</td><td style="width: 360px; height: 57px;">Llave de autorización para uso de los Servicios Web.</td><td style="width: 88px;"><span style="color: #3366ff;">50</span></td><td style="width: 288px; height: 57px;"><span role="presentation" style="padding-right: 0.1px; color: #3366ff;">25sdsd234234aa93sdsdsd37c70118e72</span></td></tr><tr style="height: 41px;"><td style="width: 117px; height: 41px;">token</td><td style="width: 360px; height: 41px;">Token devuelto por el método [**getToken**](https://docs.redgps.com/books/webservice/page/metodo-de-autenticacion-gettoken-7ef).</td><td style="width: 88px;"><span style="color: #3366ff;">500</span></td><td style="width: 288px; height: 41px;"><span style="color: #3366ff;">wfszR/oPIQKjt5HT5NgjDnZ2SAZQ==</span></td></tr><tr style="height: 114px;"><td style="width: 117px; height: 114px;">UseUTCDate</td><td style="width: 360px; height: 114px;">Valor booleano <span style="color: #ff9900;">(Opcional por defecto es 0)</span>

0 = Como la envió la unidad de rastreo.

1 = Especifica si la fecha del reporte es en formato UTC.

</td><td style="width: 88px;"><span style="color: #3366ff;">1</span>

</td><td style="width: 288px; height: 114px;"><span style="color: #3366ff;">0</span></td></tr><tr style="height: 114px;"><td style="width: 117px; height: 114px;">sensores</td><td style="width: 360px; height: 114px;">Valor booleano

0 = No trae la información de los sensores.

1 = Especifica si se desea obtener la información de sensores.

</td><td style="width: 88px;"><span style="color: #3366ff;">1</span>

</td><td style="width: 288px; height: 114px;"><span style="color: #3366ff;">1</span></td></tr></tbody></table>

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

```shell
curl --location --request POST 'https://api.service24gps.com/api/v1/getdata' \
--form 'apikey="25sdsd234234aa93sdsdsd37c70118e72"' \
--form 'token="wfszR/oPIQKjt5HT5NgjDnZ2SAZQ=="'
--form 'UseUTCDate="0"' \
--form 'sensores="1"'
```

##### Respuesta de ejemplo:

```JSON
{
	"status": 200,
	"data": [
	{
		"UnitId": "Jeep Patriot",
		"UnitPlate": "NTX9553",
		"GpsIdentif": "0580012342332337",
		"ReportDate": "2021-04-26 16:42:43",
		"Latitude": "+19.528530",
		"Longitude": "-99.171165",
      	"UrlLocation": "https://maps.google.com/?ie=UTF8&q=19.7893235448976,-98.96555386318250",
		"Altitude": 0,
		"GpsSpeed": "0",
		"Direction": "N",
		"Satellites": "22",
		"Ignition": "0",
		"Odometer": 0,
		"IdEvento": "1",
		"Domicilio": "Camino a San Juan Ixtacala 479, San Juan, Gustavo A. Madero, Mexico City, Mexico",
		"Puerto": "",
		"IpOrigen": "",
		"BateriaGps": "-1",
		"BateriaVeh": "-1",
		"Grupo": null,
		"Conductor": "Salvador Lopez",
		"Inputs": "0|0|0|0|0|0|0|0|0|0|0|0|0|0|0",
        "TipoDato": "Ubicación",
        "Senal": "62",
        "InsertionDate": "2021-04-26 16:43:13",
		"Sensores": ""
	}
	]
}
```

<p class="callout danger"><span style="color: #993300;">**Nota:** Los campos con valor **-1** se refieren que no se han enviado por el dispositivo de rastreo.</span></p>

<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: 1185px;"><tbody><tr style="height: 47px;"><th style="width: 174px; height: 47px;">Campo</th><th style="width: 392px; height: 47px;">Descripción

</th><th style="width: 243px; height: 47px;">Formato</th></tr><tr style="height: 41px;"><td style="width: 174px; height: 41px;">UnitId</td><td style="width: 392px; height: 41px;">Valor por el qué es identificada la unidad o vehículo.</td><td style="width: 243px; height: 41px;">Cadena de Texto</td></tr><tr style="height: 41px;"><td style="width: 174px; height: 41px;">UnitPlate</td><td style="width: 392px; height: 41px;">Se refiere a la placa/patente del vehículo.</td><td style="width: 243px; height: 41px;">Cadena de Texto</td></tr><tr style="height: 69px;"><td style="width: 174px; height: 69px;">GpsIdentif</td><td style="width: 392px; height: 69px;">Número de serie o IMEI que permite identificar el dispositivo de rastreo

</td><td style="width: 243px; height: 69px;">Cadena de Texto, con longitud de 16 caracteres.</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">ReportDate

</td><td style="width: 392px; height: 47px;">Fecha/hora de la posición

</td><td style="width: 243px; height: 47px;">aaaa-mm-dd hh:mm:ss</td></tr><tr style="height: 35px;"><td style="height: 35px; width: 174px;">Latitude

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

</td><td style="height: 35px; width: 243px;">Grados decimales

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

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

</td><td style="height: 35px; width: 243px;">Grados decimales

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

</td><td style="width: 392px;">Url de localización

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

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

</td><td style="height: 35px; width: 392px;">Altitud de la posición del vehículo.

</td><td style="height: 35px; width: 243px;">Metros

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

</td><td style="height: 35px; width: 392px;">Orientación del vehículo, Norte, Sur, Este, etc.</td><td style="height: 35px; width: 243px;">Kilómetros / hora</td></tr><tr style="height: 35px;"><td style="height: 35px; width: 174px;">Direction

</td><td style="height: 35px; width: 392px;">N,S,E,O,NO,NE,SO,SE

</td><td style="height: 35px; width: 243px;">Orientación del vehículo, Norte, Sur, Este, etc.

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

</td><td style="height: 35px; width: 392px;">Número de satélites con Fix de la posición.

</td><td style="height: 35px; width: 243px;">Entero

</td></tr><tr style="height: 101px;"><td style="height: 101px; width: 174px;">Ignition

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

0 = OFF

1 = ON

2 = Desconocida

</td><td style="height: 101px; width: 243px;"> Entero

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

</td><td style="height: 35px; width: 392px;">Odómetro del vehículo en la posición.

</td><td style="height: 35px; width: 243px;">Metros

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

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

</td><td style="height: 35px; width: 243px;">Entero

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

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

</td><td style="height: 57px; width: 243px;">Cadena de texto

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

</td><td style="height: 35px; width: 392px;">Puerto de origen de reporte del equipo GPS.

</td><td style="height: 35px; width: 243px;">Entero

</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">IpOrigen</td><td style="width: 392px; height: 47px;">Ip de origen de reporte del equipo GPS</td><td style="width: 243px; height: 47px;">Cadena de texto

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

</td><td style="height: 35px; width: 392px;">Nivel de voltaje o porcentaje del equipo GPS

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

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

</td><td style="height: 35px; width: 392px;">Nivel de voltaje de la fuente conectada al GPS.

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

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

</td><td style="height: 35px; width: 392px;">Nombre del grupo al que pertenece el vehículo.

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

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

</td><td style="height: 35px; width: 392px;">Nombre del conductor asociado al vehículo.

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

</td></tr><tr style="height: 92px;"><td style="width: 174px; height: 92px;">Inputs

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

0 = Desactivada

1 = Activada.

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

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

</td><td style="width: 392px; height: 47px;">Tipo de dato.

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

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

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

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

</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;"><div><div>InsertionDate</div></div></td><td style="width: 392px; height: 47px;">Fecha/hora de inserción.

</td><td style="width: 243px; height: 47px;">aaaa-mm-dd hh:mm:ss

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

</td><td style="width: 392px; height: 47px;">Json de datos de los sensores

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

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

</div></details>##### Formato de respuesta de sensores

<details class="mb-m" id="bkmrk-ver-formatos%3A-format"><summary class="text-muted">Ver formato:</summary>

<div><table class="table" style="width: 819px; height: 213px;"><tbody><tr style="height: 41px;"><th style="width: 99px; height: 58px;">Nombre</th><th style="width: 182px; height: 58px;">Descripción </th><th style="width: 248px; height: 58px;">Valor de la propiedad</th><th style="width: 290px; height: 58px;">Ejemplo</th></tr><tr style="height: 58px;"><td style="width: 99px; height: 108px;">**Sensores**</td><td style="width: 182px; height: 108px;">Formato de respuesta de la petición.

</td><td style="width: 248px; height: 108px;">- **82:** Id del sensor.
- **Bateria\_gps:** nombre del sensor.
- Valores enviados por el equipo relacionado al sensor (Consulta el listado de sensores en [**getSensors**](https://docs.redgps.com/books/webservice/page/lista-de-sensores-getsensors)).

</td><td style="width: 290px; height: 108px;"><div data-block="true" data-editor="46is8" data-offset-key="es9i-0-0"><div data-offset-key="es9i-0-0"><span style="color: #3366ff;">"82":{</span></div><div data-offset-key="es9i-0-0"><span style="color: #3366ff;"> "Bateria\_gps":{</span></div><div data-offset-key="es9i-0-0"><span style="color: #3366ff;"> "nombre": "Bateria\_gps",</span></div><div data-offset-key="es9i-0-0"><span style="color: #3366ff;"> "valor": "0", "fecha": "2023-03-14 12:01:51"</span></div><div data-offset-key="es9i-0-0"><span style="color: #3366ff;"> }</span></div></div><div data-block="true" data-editor="46is8" data-offset-key="dcb9b-0-0"><div data-offset-key="dcb9b-0-0"><span style="color: #3366ff;">}</span></div></div></td></tr></tbody></table>

</div></details>