# Plataforma - OnBus



# 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>

# Programar ruta OnBus - programRouteOnBus

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

Programa la salida de una ruta para el sistema OnBus.

<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: 121px;">**Parámetros**</td><td style="width: 360px;">**Descripción**</td><td style="width: 328px;"><span style="color: #000000;">**<span role="presentation" style="padding-right: 0.1px;">Ejemplo</span>**</span></td></tr><tr style="height: 57px;"><td style="width: 121px; height: 57px;">apikey</td><td style="width: 360px; height: 57px;">Llave de autorización para uso de los Servicios Web.</td><td style="width: 328px; height: 57px;"><span role="presentation" style="padding-right: 0.1px; color: #3366ff;">25sdsd234234aa93sdsdsd37c70118e72</span></td></tr><tr style="height: 41px;"><td style="width: 121px; height: 41px;">token</td><td style="width: 360px; height: 41px;">Token devuelto por el método getToken.</td><td style="width: 328px; height: 41px;"><span style="color: #3366ff;">wfszR/oPIQKjt5HT5NgjDnZ2SAZQ==</span></td></tr><tr><td style="width: 121px;">idruta

</td><td style="width: 360px;">Identificador único de la ruta que se va a utilizar para la programación de salida de ruta.

</td><td style="width: 328px;"><span style="color: #3366ff;"> 2533</span></td></tr><tr><td style="width: 121px;">idactivo

</td><td style="width: 360px;">Identificador único del activo que realizará el recorrido de la ruta seleccionada.

</td><td style="width: 328px;"><span style="color: #3366ff;">13953 </span></td></tr><tr><td style="width: 121px;">nombre

</td><td style="width: 360px;">Nombre asignado a la ruta programada

</td><td style="width: 328px;"><span style="color: #3366ff;">OnBus APII </span></td></tr><tr><td style="width: 121px;">definicion

</td><td style="width: 360px;">Definición de los puntos

</td><td style="width: 328px;"><span style="color: #3366ff;">{</span>  
<span style="color: #3366ff;"> "distancia":"80",</span>  
<span style="color: #3366ff;"> "frecuenciaSalida":"10",</span>  
<span style="color: #3366ff;"> "lugares":\[</span>  
<span style="color: #3366ff;"> {</span>  
<span style="color: #3366ff;"> "id":"11789",</span>  
<span style="color: #3366ff;"> "tipo":"2",</span>  
<span style="color: #3366ff;"> "orden":"1",</span>  
<span style="color: #3366ff;"> "nombre":"TERMINAL BOGOTA",</span>  
<span style="color: #3366ff;"> "dist\_pa":"0",</span>  
<span style="color: #3366ff;"> "latLng":"4.611841,-74.17858",</span>  
<span style="color: #3366ff;"> "fEstimada":"",</span>  
<span style="color: #3366ff;"> "timeBetween":"0",</span>  
<span style="color: #3366ff;"> "distLleg":"500",</span>  
<span style="color: #3366ff;"> "orientacion":"",</span>  
<span style="color: #3366ff;"> "salidaEstimada":"2018-05-05 18:01:18"</span>  
<span style="color: #3366ff;"> }</span>  
<span style="color: #3366ff;">\],</span>  
<span style="color: #3366ff;">"conductor1":\[</span>  
<span style="color: #3366ff;"> {</span>  
<span style="color: #3366ff;"> "id":2300,</span>  
<span style="color: #3366ff;"> "codigo":"KS8374",</span>  
<span style="color: #3366ff;"> "nombre":"Karla Segovia"</span>  
<span style="color: #3366ff;"> }</span>  
<span style="color: #3366ff;">\],</span>  
<span style="color: #3366ff;">"conductor2":\[</span>  
<span style="color: #3366ff;"> {</span>  
<span style="color: #3366ff;"> "id":2297,</span>  
<span style="color: #3366ff;"> "codigo":"CM5732",</span>  
<span style="color: #3366ff;"> "nombre":"Luis Morales"</span>  
<span style="color: #3366ff;"> }</span>  
<span style="color: #3366ff;">\],</span>  
<span style="color: #3366ff;">"creado":"2021-05-05 18:01:18"</span>  
<span style="color: #3366ff;">}</span></td></tr><tr><td style="width: 121px;">fecha\_inicio

</td><td style="width: 360px;">Fecha en la que deberá iniciar la salida de ruta

</td><td style="width: 328px;"><span style="color: #3366ff;"> 2021-05-05</span></td></tr><tr><td style="width: 121px;">hora\_inicio

</td><td style="width: 360px;">Hora en la que deberá iniciar la salida de ruta

</td><td style="width: 328px;"><span style="color: #3366ff;">17:00:00 </span></td></tr><tr><td style="width: 121px;">fecha\_fin

</td><td style="width: 360px;">Fecha en la que finalizará la ruta (se debe enviar vacío en caso de no utilizarlo)

</td><td style="width: 328px;"><span style="color: #3366ff;"> 2021-05-05</span></td></tr><tr><td style="width: 121px;">hora\_fin

</td><td style="width: 360px;">Hora en la que finalizará la ruta (se debe enviar vacío en caso de no utilizarlo)

</td><td style="width: 328px;"><span style="color: #3366ff;"> 19:50:00</span></td></tr></tbody></table>

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

```shell
curl --location --request POST 'https://api.service24gps.com/api/v1/programRouteOnBus' \
--header 'Cookie: PHPSESSID=0ab8djc97ouk13tev2t9epf1l2' \
--form 'apikey="25sdsd234234aa93sdsdsd37c70118e72"' \
--form 'token="wfszR/oPIQKjt5HT5NgjDnZ2SAZQ=="' \
--form 'idruta="2533"' \
--form 'idactivo="13953"' \
--form 'nombre="OnBus APII"' \
--form 'definicion="{\"distancia\":\"80\",\"frecuenciaSalida\":\"10\",\"lugares\":[{\"id\":\"11789\",\"tipo\":\"2\",\"orden\":\"1\",\"nombre\":\"TERMINAL BOGOTA\",\"dist_pa\":\"0\",\"latLng\":\"4.653657365711841,-74.1157141327858\",\"fEstimada\":\"\",\"timeBetween\":\"0\",\"distLleg\":\"500\",\"orientacion\":\"\",\"salidaEstimada\":\"2018-05-05 18:01:18\"}],\"conductor1\":[{\"id\":2300,\"codigo\":\"KS8374\",\"nombre\":\"Karla Segovia\"}],\"conductor2\":[{\"id\":2297,\"codigo\":\"CM5732\",\"nombre\":\"Luis Morales\"}],\"creado\":\"2021-05-05 18:01:18\"}"' \
--form 'fecha_inicio="2021-05-05"' \
--form 'hora_inicio="17:00:00"' \
--form 'fecha_fin="2021-05-05"' \
--form 'hora_fin="19:50:00"'
```

##### Respuesta de ejemplo:

```JSON
{
    "status": 200,
    "data": {
        "id": "2080129"
    }
}
```

# Actualizar ruta programada OnBus - updateRouteOnBus

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

Actualiza la información de salida de una ruta para el sistema OnBus.

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

<div><table class="table" style="height: 877px;"><tbody><tr><td style="width: 188px;">**Parámetros**</td><td style="width: 320px;">**Descripción**</td><td style="width: 301px;">**<span role="presentation" style="padding-right: 0.1px; color: #000000;">Ejemplo</span>**</td></tr><tr style="height: 57px;"><td style="width: 188px; height: 57px;">apikey</td><td style="width: 320px; 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: 188px; height: 41px;">token</td><td style="width: 320px; 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 style="height: 69px;"><td style="width: 188px; height: 69px;">id

</td><td style="width: 320px; height: 69px;">Identificador único de la ruta programada en el sistema.

</td><td style="width: 301px; height: 69px;"><div><div><span style="color: #3366ff;">2080129</span></div></div></td></tr><tr style="height: 47px;"><td style="width: 188px; height: 47px;">nombre

</td><td style="width: 320px; height: 47px;">Nombre asignado a la ruta programada

</td><td style="width: 301px; height: 47px;"><span style="color: #3366ff;">OnBus APII </span></td></tr><tr style="height: 249px;"><td style="width: 188px; height: 249px;">definicion

</td><td style="width: 320px; height: 249px;">Definición de los puntos

</td><td style="width: 301px; height: 249px;"><span style="color: #3366ff;">{</span>  
<span style="color: #3366ff;"> "distancia":"80",</span>  
<span style="color: #3366ff;"> "frecuenciaSalida":"10",</span>  
<span style="color: #3366ff;"> "lugares":\[</span>  
<span style="color: #3366ff;"> {</span>  
<span style="color: #3366ff;"> "id":"11789",</span>  
<span style="color: #3366ff;"> "tipo":"2",</span>  
<span style="color: #3366ff;"> "orden":"1",</span>  
<span style="color: #3366ff;"> "nombre":"TERMINAL BOGOTA",</span>  
<span style="color: #3366ff;"> "dist\_pa":"0",</span>  
<span style="color: #3366ff;"> "latLng":"4.611841,-74.17858",</span>  
<span style="color: #3366ff;"> "fEstimada":"",</span>  
<span style="color: #3366ff;"> "timeBetween":"0",</span>  
<span style="color: #3366ff;"> "distLleg":"500",</span>  
<span style="color: #3366ff;"> "orientacion":"",</span>  
<span style="color: #3366ff;"> "salidaEstimada":"2018-05-05 18:01:18"</span>  
<span style="color: #3366ff;"> }</span>  
<span style="color: #3366ff;">\],</span>  
<span style="color: #3366ff;">"conductor1":\[</span>  
<span style="color: #3366ff;"> {</span>  
<span style="color: #3366ff;"> "id":2300,</span>  
<span style="color: #3366ff;"> "codigo":"KS8374",</span>  
<span style="color: #3366ff;"> "nombre":"Karla Segovia"</span>  
<span style="color: #3366ff;"> }</span>  
<span style="color: #3366ff;">\],</span>  
<span style="color: #3366ff;">"conductor2":\[</span>  
<span style="color: #3366ff;"> {</span>  
<span style="color: #3366ff;"> "id":2297,</span>  
<span style="color: #3366ff;"> "codigo":"CM5732",</span>  
<span style="color: #3366ff;"> "nombre":"Luis Morales"</span>  
<span style="color: #3366ff;"> }</span>  
<span style="color: #3366ff;">\],</span>  
<span style="color: #3366ff;">"creado":"2021-05-05 18:01:18"</span>  
<span style="color: #3366ff;">}</span></td></tr></tbody></table>

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

```shell
curl --location --request POST 'https://api.service24gps.com/api/v1/updateRouteOnBus' \
--header 'Cookie: PHPSESSID=0ab8djc97ouk13tev2t9epf1l2' \
--form 'apikey="f77c31ce81907cc5f0ecffeda60fb4f6"' \
--form 'token="SJx5eXC7PtRJwHcSY8O8DYbTUZGQCSkTRD9VvriKevvpsCpxC49cJQ=="' \
--form 'id="2080129"' \
--form 'nombre="Prueba update OnBusAPII 1"' \
--form 'definicion="{\"distancia\":\"80\",\"frecuenciaSalida\":\"10\",\"lugares\":[{\"id\":\"11789\",\"tipo\":\"2\",\"orden\":\"1\",\"nombre\":\"TERMINAL BOGOTA\",\"dist_pa\":\"0\",\"latLng\":\"4.653657365711841,-74.1157141327858\",\"fEstimada\":\"\",\"timeBetween\":\"0\",\"distLleg\":\"500\",\"orientacion\":\"\",\"salidaEstimada\":\"2018-05-17 18:01:18\"}],\"conductor1\":[{\"id\":2300,\"codigo\":\"KS8374\",\"nombre\":\"Karla Segovia\"}],\"conductor2\":[{\"id\":2297,\"codigo\":\"CM5732\",\"nombre\":\"Luis Morales\"}],\"creado\":\"2021-05-17 18:01:18\"}"'
```

##### Respuesta de ejemplo:

```JSON
{
    "status": 200,
    "data": {
        "id": "2080129"
    }
}
```

# Eliminar ruta programda OnBus - deleteProgrammedRouteOnBus

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

Elimina una ruta programada.

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

<div><table class="table" style="height: 269px;"><tbody><tr><td style="width: 188px;">**Parámetros**</td><td style="width: 320px;">**Descripción**</td><td style="width: 301px;">**<span role="presentation" style="padding-right: 0.1px; color: #000000;">Ejemplo</span>**</td></tr><tr style="height: 57px;"><td style="width: 188px; height: 57px;">apikey</td><td style="width: 320px; 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: 188px; height: 41px;">token</td><td style="width: 320px; 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: 188px;">idruta

</td><td style="width: 320px;">Identificador único de la ruta programada.

</td><td style="width: 301px;"><span style="color: #3366ff;"> <span role="presentation">138225</span></span></td></tr></tbody></table>

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

```shell
curl --location --request POST 'https://api.service24gps.com/api/v1/getProgrammedRoutesOnBus' \
--form 'apikey="25sdsd234234aa93sdsdsd37c70118e72"' \
--form 'token="wfszR/oPIQKjt5HT5NgjDnZ2SAZQ=="' \
--form 'idRuta="138225"'
```

##### Respuesta de ejemplo:

```JSON
{
    "status": 200,
    "data": ""
}
```

# Listar rutas OnBus - getRoutesOnBus

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

Obtiene la lista de todas las rutas OnBus que pertenecen al cliente.

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

<div><table class="table" style="height: 139px;"><tbody><tr style="height: 41px;"><th style="width: 188px; height: 41px;">Parámetros</th><th style="width: 320px; height: 41px;">Descripción</th><th style="width: 301px; height: 41px;">Ejemplo</th></tr><tr style="height: 57px;"><td style="width: 188px; height: 57px;">apikey</td><td style="width: 320px; 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: 188px; height: 41px;">token</td><td style="width: 320px; 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></tbody></table>

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

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

##### Respuesta de ejemplo:

```JSON
{
    "status": 200,
    "data": [
        {
            "distancia": 80,
            "lugares": [
                {
                    "id": "234208",
                    "tipo": 1,
                    "orden": "4",
                    "nombre": "numero 4",
                    "dist_pa": 36,
                    "latLng": "19.030818,-98.21381",
                    "fEstimada": "",
                    "tolerancia": "0",
                    "timeBetween": 5,
                    "distLleg": 15,
                    "orientacion": "",
                    "completado": "0",
                    "ViajeHora": "0",
                    "ViajeMin": "5",
                    "TiempoParado": "0",
                    "RadioPunto": "15",
                    "HoraConfigHorario": "Invalid date"
                },
                {
                    "id": "234209",
                    "tipo": 1,
                    "orden": "5",
                    "nombre": "numero 5",
                    "dist_pa": 109,
                    "latLng": "19.03168,-98.213316",
                    "fEstimada": "",
                    "tolerancia": "0",
                    "timeBetween": 5,
                    "distLleg": 15,
                    "orientacion": "",
                    "completado": "0",
                    "ViajeHora": "0",
                    "ViajeMin": "5",
                    "TiempoParado": "0",
                    "RadioPunto": "15",
                    "HoraConfigHorario": "Invalid date"
                },
                {
                    "id": "234210",
                    "tipo": 1,
                    "orden": "6",
                    "nombre": "numero 6",
                    "dist_pa": 227,
                    "latLng": "19.030686,-98.211428",
                    "fEstimada": "",
                    "tolerancia": "0",
                    "timeBetween": 5,
                    "distLleg": 15,
                    "orientacion": "",
                    "completado": "0",
                    "ViajeHora": "0",
                    "ViajeMin": "5",
                    "TiempoParado": "0",
                    "RadioPunto": "15",
                    "HoraConfigHorario": "Invalid date"
                }
            ],
            "descripcion": "Ruta test",
            "tiempoEstimado": "31-03-2022",
            "id": "1602",
            "nombre": "Ruta de Prueba."
        }
    ]
}
```

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

</th><th style="width: 228px; height: 47px;">Formato</th></tr><tr style="height: 41px;"><td style="width: 174px; height: 41px;">distancia</td><td style="width: 407px; height: 41px;">Distancia en metros para considerar que se llegó a un lugar, éste valor aplica para los lugares que tengan distLleg = 0.

</td><td style="width: 228px; height: 41px;">Entero</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">lugares</td><td style="width: 407px; height: 47px;">Información de los lugares que conforman la ruta.

</td><td style="width: 228px; height: 47px;">Arreglo de objetos</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">descripcion</td><td style="width: 407px; height: 47px;">Descripción breve de la ruta.

</td><td style="width: 228px; height: 47px;">Cadena de texto</td></tr><tr style="height: 35px;"><td style="height: 35px; width: 174px;">tiempoEstimado

</td><td style="width: 407px; height: 35px;">Fecha en la que se crea la ruta.</td><td style="height: 35px; width: 228px;">Date (dd-mm-aaaa)

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

</td><td style="width: 407px; height: 35px;">Identificador único de la ruta en el sistema.

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

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

</td><td style="width: 407px; height: 35px;">Nombre con el que se identifica la ruta en el sistema.

</td><td style="height: 35px; width: 228px;">Cadena de texto</td></tr></tbody></table>

</div></details>

# Crear ruta OnBus - createRouteOnBus

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

Permite crear la definición o serie de puntos que conforman una ruta; la cual estará disponible para ser utilizada con OnBus.

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

<div><table class="table" style="width: 809px; height: 946px;"><tbody><tr style="height: 41px;"><th style="width: 146px; height: 41px;">Parámetros</th><th style="width: 353px; height: 41px;">Descripción</th><th style="width: 310px; height: 41px;">Ejemplo</th></tr><tr style="height: 41px;"><td style="width: 146px; height: 41px;">apikey</td><td style="width: 353px; height: 41px;">Llave de autorización para uso de los Servicios Web.</td><td style="width: 310px; height: 41px;"><span role="presentation" style="padding-right: 0.1px; color: #3366ff;">25sdsd234234aa93sdsdsd37c70118e72</span></td></tr><tr style="height: 41px;"><td style="width: 146px; height: 41px;">token</td><td style="width: 353px; height: 41px;">Token devuelto por el método getToken.</td><td style="width: 310px; height: 41px;"><span role="presentation" style="padding-right: 0.1px; color: #3366ff;">wfszR/oPIQKjt5HT5NgjDnZ2SAZQ==</span></td></tr><tr style="height: 69px;"><td style="width: 146px; height: 69px;">nombre</td><td style="width: 353px; height: 69px;">Nombre con el que se identifica la ruta en el sistema.

</td><td style="width: 310px; height: 69px;"><span style="color: #3366ff;">Test RouteOnBus</span></td></tr><tr><td style="width: 146px;">definicion

</td><td style="width: 353px;">Definición de los puntos.

</td><td style="width: 310px;"><span style="color: #3366ff;">{</span>  
<span style="color: #3366ff;"> "distancia": 80,</span>

<span style="color: #3366ff;"> "lugares": \[</span>

<span style="color: #3366ff;"> {</span>  
<span style="color: #3366ff;"> "id": "234210",</span>  
<span style="color: #3366ff;"> "tipo": 1,</span>  
<span style="color: #3366ff;"> "orden": "6",</span>  
<span style="color: #3366ff;"> "nombre": "numero 6",</span>  
<span style="color: #3366ff;"> "dist\_pa": 227,</span>  
<span style="color: #3366ff;"> "latLng": "19.030686,-98.211428",</span>  
<span style="color: #3366ff;"> "fEstimada": "",</span>  
<span style="color: #3366ff;"> "tolerancia": "0",</span>  
<span style="color: #3366ff;"> "timeBetween": 5,</span>  
<span style="color: #3366ff;"> "distLleg": 15,</span>  
<span style="color: #3366ff;"> "orientacion": "",</span>  
<span style="color: #3366ff;"> "completado": "0",</span>  
<span style="color: #3366ff;"> "ViajeHora": "0",</span>  
<span style="color: #3366ff;"> "ViajeMin": "5",</span>  
<span style="color: #3366ff;"> "TiempoParado": "0",</span>  
<span style="color: #3366ff;"> "RadioPunto": "15",</span>  
<span style="color: #3366ff;"> "HoraConfigHorario": "Invalid date"</span>  
<span style="color: #3366ff;"> }</span>  
<span style="color: #3366ff;"> \],</span>  
<span style="color: #3366ff;"> "descripcion": "Ruta test",</span>  
<span style="color: #3366ff;"> "tiempoEstimado": "31-01-2018",</span>  
<span style="color: #3366ff;"> "nombre": "Ruta de Prueba."</span>

<span style="color: #3366ff;">}</span>

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

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

```shell
curl --location --request POST 'https://api.service24gps.com/api/v1/createRouteOnBus' \
--form 'apikey="25sdsd234234aa93sdsdsd37c70118e72"' \
--form 'token="wfszR/oPIQKjt5HT5NgjDnZ2SAZQ=="' \
--form 'nombre="Test RouteOnBus"' \
--form 'definicion="{\"distancia\":80,\"lugares\":[{\"id\":\"234210\",\"tipo\": 1,\"orden\":\"6\",\"nombre\": \"numero 6\",\"dist_pa\": 227,\"latLng\"\"19.030686,-98.211428\",\"fEstimada\": \"\",\"tolerancia\": \"0\",\"timeBetween\": 5,\"distLleg\": 15,\"orientacion\": \"\",\"completado\": \"0\",\"ViajeHora\": \"0\",\"ViajeMin\": \"5\",\"TiempoParado\": \"0\",\"RadioPunto\": \"15\",\"HoraConfigHorario\": \"Invalid date\"}],\"descripcion\": \"Ruta test\",\"tiempoEstimado\": \"31-01-2018\",\"id\": \"1602\",\"nombre\": \"Ruta de Prueba.\"}"'

```

##### Respuesta de ejemplo:

```JSON
{
    "status": 200,
    "data": {
        "id": "2300129"
    }
}
```

# Actualizar ruta OnBus - updateRouteOnBus

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

Permite realizar la modificación de la información de una ruta.

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

<div><table class="table" style="width: 809px; height: 946px;"><tbody><tr style="height: 41px;"><th style="width: 123px; height: 41px;">Parámetros</th><th style="width: 378px; height: 41px;">Descripción</th><th style="width: 308px; height: 41px;">Ejemplo</th></tr><tr style="height: 41px;"><td style="width: 123px; height: 41px;">apikey</td><td style="width: 378px; height: 41px;">Llave de autorización para uso de los Servicios Web.</td><td style="width: 308px; height: 41px;"><span role="presentation" style="padding-right: 0.1px; color: #3366ff;">25sdsd234234aa93sdsdsd37c70118e72</span></td></tr><tr style="height: 41px;"><td style="width: 123px; height: 41px;">token</td><td style="width: 378px; height: 41px;">Token devuelto por el método getToken.</td><td style="width: 308px; height: 41px;"><span role="presentation" style="padding-right: 0.1px; color: #3366ff;">wfszR/oPIQKjt5HT5NgjDnZ2SAZQ==</span></td></tr><tr style="height: 69px;"><td style="width: 123px; height: 69px;">id</td><td style="width: 378px; height: 69px;">Identificador único de la ruta en el sistema.

</td><td style="width: 308px; height: 69px;"><span role="presentation" style="padding-right: 0.1px;"><span style="color: #3366ff;">Update Test Nombre 3</span></span></td></tr><tr><td style="width: 123px;">nombre

</td><td style="width: 378px;">Nombre con el que se identificará la ruta en el sistema.

</td><td style="width: 308px;"><span style="color: #3366ff;">New Driver 3</span>

</td></tr><tr><td style="width: 123px;">definicion

</td><td style="width: 378px;">Definición de los puntos.

</td><td style="width: 308px;"><span style="color: #3366ff;">{</span>  
<span style="color: #3366ff;"> "distancia": 80,</span>

<span style="color: #3366ff;"> "lugares": \[</span>

<span style="color: #3366ff;"> {</span>  
<span style="color: #3366ff;"> "id": "2300129",</span>  
<span style="color: #3366ff;"> "tipo": 1,</span>  
<span style="color: #3366ff;"> "orden": "6",</span>  
<span style="color: #3366ff;"> "nombre": "numero 6",</span>  
<span style="color: #3366ff;"> "dist\_pa": 227,</span>  
<span style="color: #3366ff;"> "latLng": "19.030686,-98.211428",</span>  
<span style="color: #3366ff;"> "fEstimada": "",</span>  
<span style="color: #3366ff;"> "tolerancia": "0",</span>  
<span style="color: #3366ff;"> "timeBetween": 5,</span>  
<span style="color: #3366ff;"> "distLleg": 15,</span>  
<span style="color: #3366ff;"> "orientacion": "",</span>  
<span style="color: #3366ff;"> "completado": "0",</span>  
<span style="color: #3366ff;"> "ViajeHora": "0",</span>  
<span style="color: #3366ff;"> "ViajeMin": "5",</span>  
<span style="color: #3366ff;"> "TiempoParado": "0",</span>  
<span style="color: #3366ff;"> "RadioPunto": "15",</span>  
<span style="color: #3366ff;"> "HoraConfigHorario": "Invalid date"</span>  
<span style="color: #3366ff;"> }</span>  
<span style="color: #3366ff;"> \],</span>  
<span style="color: #3366ff;"> "descripcion": "Ruta test",</span>  
<span style="color: #3366ff;"> "tiempoEstimado": "31-01-2018",</span>  
<span style="color: #3366ff;"> "id": "2300129",</span>  
<span style="color: #3366ff;"> "nombre": "Ruta de Prueba."</span>

<span style="color: #3366ff;">}</span>

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

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

```shell
curl --location --request POST 'https://api.service24gps.com/api/v1/updateRouteOnBus' \
--form 'apikey="25sdsd234234aa93sdsdsd37c70118e72"' \
--form 'token="wfszR/oPIQKjt5HT5NgjDnZ2SAZQ=="' \
--form 'nombre="Test RouteOnBus"' \
--form 'definicion="{\"distancia\":80,\"lugares\":[{\"id\":\"2300129\",\"tipo\": 1,\"orden\":\"6\",\"nombre\": \"numero 6\",\"dist_pa\": 227,\"latLng\"\"19.030686,-98.211428\",\"fEstimada\": \"\",\"tolerancia\": \"0\",\"timeBetween\": 5,\"distLleg\": 15,\"orientacion\": \"\",\"completado\": \"0\",\"ViajeHora\": \"0\",\"ViajeMin\": \"5\",\"TiempoParado\": \"0\",\"RadioPunto\": \"15\",\"HoraConfigHorario\": \"Invalid date\"}],\"descripcion\": \"Ruta test\",\"tiempoEstimado\": \"31-01-2018\",\"id\": \"1602\",\"nombre\": \"Ruta de Prueba.\"}"'
```

##### Respuesta de ejemplo:

```JSON
{
    "status": 200,
    "data": {
        "id": "2300129"
    }
}
```

# Eliminar ruta OnBus - deleteRouteOnBus

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

Este método permite eliminar una ruta especifica.

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

<div><table class="table" style="width: 809px;"><tbody><tr><th style="width: 146px;">Parámetros</th><th style="width: 370px;">Descripción</th><th style="width: 293px;">Ejemplo</th></tr><tr><td style="width: 146px;">apikey</td><td style="width: 370px;">Llave de autorización para uso de los Servicios Web.</td><td style="width: 293px;"><span role="presentation" style="padding-right: 0.1px; color: #3366ff;">25sdsd234234aa93sdsdsd37c70118e72</span></td></tr><tr><td style="width: 146px;">token</td><td style="width: 370px;">Token devuelto por el método getToken.</td><td style="width: 293px;"><span role="presentation" style="padding-right: 0.1px; color: #3366ff;">wfszR/oPIQKjt5HT5NgjDnZ2SAZQ==</span></td></tr><tr><td style="width: 146px;">idRuta</td><td style="width: 370px;" width="351">Identificador único de la ruta en el sistema.

</td><td style="width: 293px;"><span role="presentation" style="padding-right: 0.1px;"><span style="color: #3366ff;"> 138225</span></span></td></tr></tbody></table>

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

```shell
curl --location --request POST 'https://api.service24gps.com/api/v1/deleteRouteOnBus' \
--form 'apikey="25sdsd234234aa93sdsdsd37c70118e72"' \
--form 'token="wfszR/oPIQKjt5HT5NgjDnZ2SAZQ=="' \
--form 'idRuta="138225"'
```

##### Respuesta de ejemplo:

```JSON
{
    "status": 200,
    "data": ""
}
```