# Listar rutas programadas OnBus - getProgrammedRoutesOnBus

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

Obtiene el listado de todas las rutas programadas que se encuentran pendientes, en proceso, iniciadas o canceladas, ya sea en el día en curso u opcionalmente en un rango de fechas específico (máximo 5 días).

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

<div><table class="table" style="height: 269px;"><tbody><tr><td style="width: 173px;">**Parámetros**</td><td style="width: 335px;">**Descripción**</td><td style="width: 301px;"><span style="color: #000000;">**<span role="presentation" style="padding-right: 0.1px;">Ejemplo</span>**</span></td></tr><tr style="height: 57px;"><td style="width: 173px; height: 57px;">apikey</td><td style="width: 335px; height: 57px;">Llave de autorización para uso de los Servicios Web.</td><td style="width: 301px; height: 57px;"><span role="presentation" style="padding-right: 0.1px; color: #3366ff;">25sdsd234234aa93sdsdsd37c70118e72</span></td></tr><tr style="height: 41px;"><td style="width: 173px; height: 41px;">token</td><td style="width: 335px; height: 41px;">Token devuelto por el método getToken.</td><td style="width: 301px; height: 41px;"><span style="color: #3366ff;">wfszR/oPIQKjt5HT5NgjDnZ2SAZQ==</span></td></tr><tr><td style="width: 173px;">fecha\_inicio</td><td style="width: 335px;">Fecha inicial desde la que se buscarán las rutas.</td><td style="width: 301px;"><span style="color: #3366ff;">2021-05-05</span></td></tr><tr><td style="width: 173px;">fecha\_final</td><td style="width: 335px;">Fecha final hasta donde se realizará la búsqueda de las rutas.</td><td style="width: 301px;"><span style="color: #3366ff;">2021-05-05</span></td></tr></tbody></table>

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

```shell
curl --location --request POST 'https://api.service24gps.com/api/v1/getProgrammedRoutesOnBus' \
--header 'Cookie: PHPSESSID=0ab8djc97ouk13tev2t9epf1l2' \
--form 'apikey="25sdsd234234aa93sdsdsd37c70118e72"' \
--form 'token="wfszR/oPIQKjt5HT5NgjDnZ2SAZQ=="' \
--form 'fecha_inicio="2021-05-05"' \
--form 'fecha_final="2021-05-05"'
```

##### Respuesta de ejemplo:

```JSON
{
    "status": 200,
    "data": {
        "Ruta salida lugar2021-05-0500:00:00": {
            "id": "2076939",
            "nombre": "Ruta salida lugar",
            "fecha_inicio": "2021-05-05",
            "hora_inicio": "00:00:00",
            "fecha_fin": "2021-05-05",
            "hora_fin": "00:41:00",
            "idruta": "2076939",
            "fecha_completado": "0000-00-00",
            "hora_completado": "00:00:00",
            "activo": "Activo Simulado 4",
            "placa": "TXT-321",
            "comentario": "",
            "sino_creacion_manual": "0",
            "icono": "./Iconos/Vehiculos/CarIcon.png",
            "equipo": null,
            "idactivo": "13955",
            "grupo": "",
            "estado": "Pendiente",
            "definicion": {
                "distancia": 80,
                "conductor1": [
                    {
                        "id": "1960",
                        "nombre": "NELSON MAURICION BRAM",
                        "codigo": ""
                    }
                ],
                "conductor2": [
                    {
                        "id": "",
                        "nombre": "",
                        "codigo": ""
                    }
                ],
                "creado": "2021-05-17 00:00:00",
                "lugares": [
                    {
                        "id": "465845",
                        "tipo": 1,
                        "orden": "1",
                        "nombre": "el negro mandingo",
                        "dist_pa": 0,
                        "latLng": "19.059873,-98.237004",
                        "fEstimada": 0,
                        "tolerancia": "0",
                        "timeBetween": 15,
                        "distLleg": 0,
                        "orientacion": "",
                        "completado": "0",
                        "ViajeHora": "0",
                        "ViajeMin": "15",
                        "TiempoParado": "0",
                        "RadioPunto": "0",
                        "HoraConfigHorario": "Invalid date",
                        "llegadaEstimada": "2021-05-05 00:00:00",
                        "salidaEstimada": "2021-05-05 00:00:00",
                        "horaSale": "00:00",
                        "horallega": "00:00",
                        "horallegaEstimada": "00:00:00",
                        "horaSaleEstimada": "00:00:00"
                    }
                ],
                "EsHoraFija": 0
            }
        }
    }
}
```

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

<div><div><table class="table" id="bkmrk-campo-descripci%C3%B3n-fo" style="width: 809px; height: 1169px;"><tbody><tr><td style="width: 174px;">**Campo**</td><td style="width: 392px;">**Descripción**

</td><td style="width: 243px;">**Formato**</td></tr><tr><td style="width: 174px;">id</td><td style="width: 392px;">Identificador único de la ruta programada

</td><td style="width: 243px;">Entero</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">nombre</td><td style="width: 392px; height: 47px;">Nombre asignado a la ruta programada

</td><td style="width: 243px; height: 47px;">Texto</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">fecha\_inicio

</td><td style="width: 392px; height: 47px;">Fecha programada de inicio de la ruta

</td><td style="width: 243px; height: 47px;">Fecha (aaaa-mm-dd)</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">hora\_inicio

</td><td style="width: 392px; height: 47px;">Hora programada de inicio de la ruta

</td><td style="width: 243px; height: 47px;">Hora (hh:mm:ss)</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">fecha\_fin

</td><td style="width: 392px; height: 47px;">Fecha programada para finalizar la ruta

</td><td style="width: 243px; height: 47px;">Fecha (aaaa-mm-dd)</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">hora\_fin

</td><td style="width: 392px; height: 47px;">Hora programada para finalizar la ruta

</td><td style="width: 243px; height: 47px;">Hora (hh:mm:ss)</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">idruta

</td><td style="width: 392px; height: 47px;">Identificador único de la ruta de la cual se tomaron los puntos

</td><td style="width: 243px; height: 47px;">Entero</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">fecha\_completado

</td><td style="width: 392px; height: 47px;">Fecha en que se finalizó la ruta

</td><td style="width: 243px; height: 47px;">Fecha (aaaa-mm-dd)</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">hora\_completado

</td><td style="width: 392px; height: 47px;">Hora en que se finalizó la ruta

</td><td style="width: 243px; height: 47px;">Hora (hh:mm:ss)</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">activo

</td><td style="width: 392px; height: 47px;">Nombre del activo que está realizando la ruta

</td><td style="width: 243px; height: 47px;">Nombre</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;"><div><div>placa</div></div></td><td style="width: 392px; height: 47px;">Placa / patente correspondiente al activo

</td><td style="width: 243px; height: 47px;">Texto</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;"><div><div>comentario</div></div></td><td style="width: 392px; height: 47px;">Comentario creado por el sistema sobre el estado de la ruta.

</td><td style="width: 243px; height: 47px;">Texto</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;"><div><div>sino_creacion_manual</div></div></td><td style="width: 392px; height: 47px;">Indica si la ruta se creó manualmente o a partir de una programación automática.

</td><td style="width: 243px; height: 47px;">Entero</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;"><div><div>icono</div></div></td><td style="width: 392px; height: 47px;">Icono asignado al activo para identificarlo en el sistema

</td><td style="width: 243px; height: 47px;">Texto</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;"><div><div>equipo</div></div></td><td style="width: 392px; height: 47px;">Identificador único del equipo GPS asignado al activo

</td><td style="width: 243px; height: 47px;">Entero</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;"><div><div>idactivo</div></div></td><td style="width: 392px; height: 47px;">Identificador único del activo que está realizando la ruta

</td><td style="width: 243px; height: 47px;">Entero</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;"><div><div>grupo</div></div></td><td style="width: 392px; height: 47px;">Nombre del grupo al que pertenece el vehículo.

</td><td style="width: 243px; height: 47px;">Texto</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;"><div><div>estado</div></div></td><td style="width: 392px; height: 47px;">Indica el status en el que se encuentra la ruta (Iniciada, Pendiente, En proceso, Cancelada)

</td><td style="width: 243px; height: 47px;">Texto</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;"><div><div>definicion</div></div></td><td style="width: 392px; height: 47px;">Definición de los lugares que conforman la ruta

</td><td style="width: 243px; height: 47px;">Texto JSON\*</td></tr></tbody></table>

</div></div><span style="color: #ff0000;">**Nota:** El formato del texto JSON utilizado para la definición de la ruta es el mismo al del método **[programRouteOnBus](https://docs.redgps.com/books/webservice/page/programar-ruta-onbus-programrouteonbus "programRouteOnBus").**</span>

</details>