# Plataforma - OnRouting



# Crear programación de ruta - programRoute

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

Permite crear la definición o serie de puntos que conforman una ruta.

<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="width: 809px; height: 946px;"><tbody><tr style="height: 41px;"><th style="width: 146px; height: 41px;">Parámetros</th><th style="width: 370px; height: 41px;">Descripción</th><th style="width: 293px; height: 41px;">Ejemplo</th></tr><tr style="height: 41px;"><td style="width: 146px; height: 41px;">apikey</td><td style="width: 370px; height: 41px;">Llave de autorización para uso de los Servicios Web.</td><td style="width: 293px; 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: 370px; height: 41px;">Token devuelto por el método getToken.</td><td style="width: 293px; height: 41px;"><span role="presentation" style="padding-right: 0.1px; color: #3366ff;">wfszR/oPIQKjt5HT5NgjDnZ2SAZQ==</span></td></tr><tr style="height: 47px;"><td style="width: 146px; height: 47px;">id</td><td style="width: 370px; height: 47px;">Identificador único de la ruta en el sistema.

</td><td style="width: 293px; height: 47px;"><span role="presentation" style="padding-right: 0.1px;"><span style="color: #3366ff;"> 1382123</span></span></td></tr><tr><td style="width: 146px;">idruta</td><td style="width: 370px;">Identificador único de la ruta que se va a utilizar para la programación de salida de ruta.

</td><td style="width: 293px;"><span role="presentation" style="padding-right: 0.1px;"><span style="color: #3366ff;">34534</span></span></td></tr><tr><td style="width: 146px;">idactivo</td><td style="width: 370px;">Identificador único del activo que realizará el recorrido de la ruta seleccionada.

</td><td style="width: 293px;"><span style="color: #3366ff;">245855</span></td></tr><tr style="height: 69px;"><td style="width: 146px; height: 69px;">nombre</td><td style="width: 370px; height: 69px;">Nombre con el que se identificará la ruta dentro de la plataforma.

</td><td style="width: 293px; height: 69px;"><span role="presentation" style="padding-right: 0.1px;"><span style="color: #3366ff;">Prueba nombre ruta</span></span></td></tr><tr style="height: 338px;"><td style="width: 146px; height: 338px;">definición

</td><td style="width: 370px; height: 338px;">Definición de puntos.

</td><td style="width: 293px; height: 338px;"><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;"> {</span>  
<span style="color: #3366ff;"> "id":"36589",</span>  
<span style="color: #3366ff;"> "tipo":1,</span>  
<span style="color: #3366ff;"> "orden":"1",</span>  
<span style="color: #3366ff;"> "nombre":"Departamento 1",</span>  
<span style="color: #3366ff;"> "dist\_pa":0,</span>  
<span style="color: #3366ff;"> "latLng":"18.900479,-98.435602",</span>  
<span style="color: #3366ff;"> "fEstimada":"",</span>  
<span style="color: #3366ff;"> "tolerancia":0,</span>  
<span style="color: #3366ff;"> "timeBetween":0,</span>  
<span style="color: #3366ff;"> "distLleg":0,</span>  
<span style="color: #3366ff;"> "orientacion":""</span>  
<span style="color: #3366ff;"> } \],</span>  
<span style="color: #3366ff;"> "waypoints":\[  
 \],</span>  
<span style="color: #3366ff;"> "puntos":\[  
 \],</span>  
<span style="color: #3366ff;"> "rutas":\[</span>  
<span style="color: #3366ff;"> \],</span>  
<span style="color: #3366ff;"> "sinoGarmin":0,</span>  
<span style="color: #3366ff;"> "useRoutePlaces":0</span>

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

</td></tr><tr><td style="width: 146px;">fecha\_inicio

</td><td style="width: 370px;">Fecha en la que deberá iniciar la salida de ruta.

</td><td style="width: 293px;"><span style="color: #3366ff;"> 2022-02-27</span>

</td></tr><tr><td style="width: 146px;">hora\_inicio

</td><td style="width: 370px;">Hora en la que deberá iniciar la salida de ruta.

</td><td style="width: 293px;"><span style="color: #3366ff;">15:30:00</span>

</td></tr><tr><td style="width: 146px;">fecha\_fin

</td><td style="width: 370px;">Fecha en la que finalizará la ruta (se debe enviar vacío en caso de no utilizarlo).

</td><td style="width: 293px;"><span style="color: #3366ff;">2022-02-28</span>

</td></tr><tr><td style="width: 146px;">hora\_fin

</td><td style="width: 370px;">Hora en la que finalizará la ruta (se debe enviar vacío en caso de no utilizarlo).

</td><td style="width: 293px;"><span style="color: #3366ff;">20:00:00</span>

</td></tr><tr><td style="width: 146px;">dias

</td><td style="width: 370px;">Días de la semana en que se ejecutará la salida de  
ruta, los valores aceptados son: Lu, Ma, Mi, Ju, Vi.  
Sa, Do; los días se separan con el signo “-”.

</td><td style="width: 293px;"><span style="color: #3366ff;">Lu-Mi-Vi-Sa</span>

</td></tr><tr><td style="width: 146px;">periodo

</td><td style="width: 370px;">Periodo en que se reprogramará la ruta, los valores  
aceptados son:  
1 = Todos los días  
2 = Todas las semanas  
3 = Todos los meses  
4 = Todos los años  
5 = Continuamente

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

</td></tr><tr><td style="width: 146px;">repetir

</td><td style="width: 370px;">Indica la frecuencia de días, semanas, meses o años en que se debe repetir la ruta.

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

</td></tr><tr><td style="width: 146px;">veces

</td><td style="width: 370px;">Número de veces que se debe cumplir la ruta antes de finalizarla (enviar 0 en caso de no utilizarlo).

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

</td></tr><tr><td style="width: 146px;">termina

</td><td style="width: 370px;">Indica cuando se debe considerar la ruta como  
finalizada. Los valores aceptados son:  
1 = Nunca, la ruta se repite indefinidamente  
2 = Después de n veces (la cantidad de repeticiones  
se especifica en el parámetro anterior “veces”)  
3 = Finaliza en una fecha y hora específica (la fecha  
se indica en “fecha\_fin” y “hora\_fin”)  
4 = Finaliza automáticamente al llegar al último  
punto.

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

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

</div></details><span style="color: #ff0000;">**Nota:** <span style="color: #ff0000;">La **definición** debe tener el mismo formato que el utilizado en el método </span> **createRoute**<span style="color: #ff0000;">.</span></span>

##### Solicitud de ejemplo:

```shell
curl --location --request POST 'https://api.service24gps.com/api/v1/programRoute' \
--form 'apikey="25sdsd234234aa93sdsdsd37c70118e72"' \
--form 'token="wfszR/oPIQKjt5HT5NgjDnZ2SAZQ=="' \
--form 'id="1382123"' \
--form 'idruta="34534"' \
--form 'idactivo="245855"' \
--form 'nombre="Prueba nombre ruta"' \
--form 'definicion="{"distancia":80,"lugares":[{"id":"36589","tipo":1,"orden":"1","nombre":"Departamento 1","dist_pa":0,"latLng":"18.900479,-98.435602","fEstimada":"","tolerancia":0,"timeBetween":0,"distLleg":0,"orientacion":""}],"waypoints":{},"puntos":{},"rutas":[],"sinoGarmin":0,"useRoutePlaces":0}"' \
--form 'fecha_inicio="2022-02-27"' \
--form 'hora_inicio="15:30:00"' \
--form 'fecha_fin=""' \
--form 'hora_fin=""' \
--form 'dias="Lu-Mi-Vi-Sa"' \
--form 'periodo="2"' \
--form 'repetir="1"' \
--form 'veces="0"' \
--form 'termina="4"'
```

##### Respuesta de ejemplo:

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

# Listar rutas programadas - getScheduledRoutes

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

Obtiene todas las rutas programadas que se encuentren en proceso o iniciadas.

<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/getScheduledRoutes' \
--form 'apikey="25sdsd234234aa93sdsdsd37c70118e72"' \
--form 'token="wfszR/oPIQKjt5HT5NgjDnZ2SAZQ=="'
```

##### Respuesta de ejemplo:

```JSON
{
   "status":200,
   "data":[
      {
         "id":"35124391",
         "nombre":"Ruta test programada",
         "fecha_inicio":"2022-02-25",
         "hora_inicio":"17:00:00",
         "fecha_fin":"0000-00-00",
         "hora_fin":"00:00:00",
         "idruta":"35124391",
         "fecha_completado":"0000-00-00",
         "hora_completado":"00:00:00",
         "activo":"prueba",
         "placa":"prueba",
         "comentario":"",
         "sino_creacion_manual":"1",
         "icono":"./Iconos/Vehiculos/CarIcon.png",
         "equipo":"prueba",
         "idactivo":"148762",
         "estado":"Pendiente",
         "definicion":{
            "distancia":80,
            "lugares":[
               {
                  "id":"36589",
                  "tipo":1,
                  "orden":"1",
                  "nombre":"Departamento",
                  "dist_pa":0,
                  "latLng":"18.900479,-98.435602",
                  "fEstimada":"",
                  "tolerancia":0,
                  "timeBetween":0,
                  "distLleg":0,
                  "orientacion":""
               },
               {
                  "id":"36609",
                  "tipo":1,
                  "orden":"2",
                  "nombre":"Departamento 2",
                  "dist_pa":31528,
                  "latLng":"19.027292,-98.208708",
                  "fEstimada":"",
                  "tolerancia":0,
                  "timeBetween":0,
                  "distLleg":0,
                  "orientacion":""
               },
               {
                  "id":"38686",
                  "tipo":1,
                  "orden":"5",
                  "nombre":"Departamento 3",
                  "dist_pa":20511,
                  "latLng":"19.153059,-98.243021",
                  "fEstimada":"",
                  "tolerancia":0,
                  "timeBetween":0,
                  "distLleg":0,
                  "orientacion":""
               }
            ],
            "waypoints":[
               
            ],
            "puntos":[
               
            ],
            "rutas":[
               
            ],
            "sinoGarmin":0,
            "useRoutePlaces":0
         }
      }
   ]
}
```

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

</th><th style="width: 261px; height: 47px;">Formato</th></tr><tr style="height: 41px;"><td style="width: 174px; height: 41px;">id</td><td style="width: 374px; height: 41px;">Identificador único de la ruta programada.

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

</td><td style="width: 261px; height: 47px;">Arreglo de objetos</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">fecha\_inicio

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

</td><td style="width: 261px; height: 47px;">Date (aaaa-mm-dd)</td></tr><tr style="height: 35px;"><td style="height: 35px; width: 174px;">hora\_inicio</td><td style="width: 374px; height: 35px;">Hora programada de inicio de la ruta.</td><td style="height: 35px; width: 261px;">Time (hh:mm:ss)

</td></tr><tr style="height: 35px;"><td style="height: 35px; width: 174px;">fecha\_fin

</td><td style="width: 374px; height: 35px;">Fecha programada para finalizar la ruta.

</td><td style="height: 35px; width: 261px;">Date (aaaa-mm-dd)

</td></tr><tr style="height: 35px;"><td style="height: 35px; width: 174px;">hora\_fin

</td><td style="width: 374px; height: 35px;">Hora programada para finalizar la ruta.

</td><td style="height: 35px; width: 261px;">Time (hh:mm:ss)

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

</td><td style="width: 374px; height: 35px;">Identificador único de la ruta de la cual se tomaron  
los puntos.

</td><td style="height: 35px; width: 261px;">Entero</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">fecha\_completado</td><td style="width: 374px; height: 47px;">Fecha en que se finalizó la ruta.

</td><td style="width: 261px; height: 47px;">Date (aaaa-mm-dd)</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">hora\_completado</td><td style="width: 374px; height: 47px;">Hora en que se finalizó la ruta

</td><td style="width: 261px; height: 47px;">Time (hh:mm:ss)</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">activo</td><td style="width: 374px; height: 47px;">Nombre del activo que está realizando la ruta.

</td><td style="width: 261px; height: 47px;">Cadena de texto</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">placa</td><td style="width: 374px; height: 47px;">Placa / patente correspondiente al activo.

</td><td style="width: 261px; height: 47px;">Cadena de texto</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">comentario</td><td style="width: 374px; height: 47px;">Comentario o descripción breve sobre la ruta

</td><td style="width: 261px; height: 47px;">Cadena de texto</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">icono</td><td style="width: 374px; height: 47px;">Icono asignado al activo para identificarlo en el sistema.

</td><td style="width: 261px; height: 47px;">Cadena de texto</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">equipo</td><td style="width: 374px; height: 47px;">Equipo GPS asignado al activo.

</td><td style="width: 261px; height: 47px;">Entero</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">idactivo</td><td style="width: 374px; height: 47px;">Identificador único del activo que está realizando la ruta.

</td><td style="width: 261px; height: 47px;">Entero</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">estado</td><td style="width: 374px; height: 47px;">Indica el estado actual de la ruta.

</td><td style="width: 261px; height: 47px;">Cadena de texto</td></tr><tr style="height: 92px;"><td style="width: 174px; height: 92px;">distancia</td><td style="width: 374px; height: 92px;">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: 261px; height: 92px;">Entero</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">lugares</td><td style="width: 374px; height: 47px;">Información de los lugares que conforman la ruta.

</td><td style="width: 261px; height: 47px;"> Arreglo de objetos</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">waypoints</td><td style="width: 374px; height: 47px;">Puntos de referencia entre lugares de la ruta.

</td><td style="width: 261px; height: 47px;"> Arreglo de objetos</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">puntos</td><td style="width: 374px; height: 47px;">Rutas calculadas a través de la API de Google.

</td><td style="width: 261px; height: 47px;"> Arreglo de objetos</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">rutas</td><td style="width: 374px; height: 47px;">Geocercas de tipo ruta.

</td><td style="width: 261px; height: 47px;"> Arreglo de objetos</td></tr><tr style="height: 69px;"><td style="width: 174px; height: 69px;">sinoGarmin</td><td style="width: 374px; height: 69px;">Indica si el dispositivo GPS tiene integrado un sistema con pantalla Garmin.

</td><td style="width: 261px; height: 69px;">Entero</td></tr><tr style="height: 69px;"><td style="width: 174px; height: 69px;">useRoutePlaces</td><td style="width: 374px; height: 69px;">Indica si debe usar los puntos de la ruta original o de la ruta programada.

</td><td style="width: 261px; height: 69px;">Entero</td></tr></tbody></table>

</div></details>

# Actualizar ruta programada - updateScheduledRoute

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

Permite actualizar la programación de una ruta.

<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="width: 809px; height: 946px;"><tbody><tr style="height: 41px;"><th style="width: 146px; height: 41px;">Parámetros</th><th style="width: 370px; height: 41px;">Descripción</th><th style="width: 293px; height: 41px;">Ejemplo</th></tr><tr style="height: 41px;"><td style="width: 146px; height: 41px;">apikey</td><td style="width: 370px; height: 41px;">Llave de autorización para uso de los Servicios Web.</td><td style="width: 293px; 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: 370px; height: 41px;">Token devuelto por el método getToken.</td><td style="width: 293px; height: 41px;"><span role="presentation" style="padding-right: 0.1px; color: #3366ff;">wfszR/oPIQKjt5HT5NgjDnZ2SAZQ==</span></td></tr><tr style="height: 47px;"><td style="width: 146px; height: 47px;">id</td><td style="width: 370px; height: 47px;">Identificador único de la ruta en el sistema.

</td><td style="width: 293px; height: 47px;"><span role="presentation" style="padding-right: 0.1px;"><span style="color: #3366ff;"> 1382123</span></span></td></tr><tr><td style="width: 146px;">idruta</td><td style="width: 370px;">Identificador único de la ruta que se va a utilizar para la programación de salida de ruta.

</td><td style="width: 293px;"><span role="presentation" style="padding-right: 0.1px;"><span style="color: #3366ff;">34534</span></span></td></tr><tr><td style="width: 146px;">idactivo</td><td style="width: 370px;">Identificador único del activo que realizará el recorrido de la ruta seleccionada.

</td><td style="width: 293px;"><span style="color: #3366ff;">245855</span></td></tr><tr style="height: 69px;"><td style="width: 146px; height: 69px;">nombre</td><td style="width: 370px; height: 69px;">Nombre con el que se identificará la ruta dentro de la plataforma.

</td><td style="width: 293px; height: 69px;"><span role="presentation" style="padding-right: 0.1px;"><span style="color: #3366ff;">Prueba nombre ruta</span></span></td></tr><tr style="height: 338px;"><td style="width: 146px; height: 338px;">definición

</td><td style="width: 370px; height: 338px;">Definición de puntos.

</td><td style="width: 293px; height: 338px;"><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;"> {</span>  
<span style="color: #3366ff;"> "id":"36589",</span>  
<span style="color: #3366ff;"> "tipo":1,</span>  
<span style="color: #3366ff;"> "orden":"1",</span>  
<span style="color: #3366ff;"> "nombre":"Departamento 1",</span>  
<span style="color: #3366ff;"> "dist\_pa":0,</span>  
<span style="color: #3366ff;"> "latLng":"18.900479,-98.435602",</span>  
<span style="color: #3366ff;"> "fEstimada":"",</span>  
<span style="color: #3366ff;"> "tolerancia":0,</span>  
<span style="color: #3366ff;"> "timeBetween":0,</span>  
<span style="color: #3366ff;"> "distLleg":0,</span>  
<span style="color: #3366ff;"> "orientacion":""</span>  
<span style="color: #3366ff;"> } \],</span>  
<span style="color: #3366ff;"> "waypoints":\[  
 \],</span>  
<span style="color: #3366ff;"> "puntos":\[  
 \],</span>  
<span style="color: #3366ff;"> "rutas":\[</span>  
<span style="color: #3366ff;"> \],</span>  
<span style="color: #3366ff;"> "sinoGarmin":0,</span>  
<span style="color: #3366ff;"> "useRoutePlaces":0</span>

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

</td></tr><tr><td style="width: 146px;">fecha\_inicio

</td><td style="width: 370px;">Fecha en la que deberá iniciar la salida de ruta.

</td><td style="width: 293px;"><span style="color: #3366ff;"> 2022-02-27</span>

</td></tr><tr><td style="width: 146px;">hora\_inicio

</td><td style="width: 370px;">Hora en la que deberá iniciar la salida de ruta.

</td><td style="width: 293px;"><span style="color: #3366ff;">15:30:00</span>

</td></tr><tr><td style="width: 146px;">fecha\_fin

</td><td style="width: 370px;">Fecha en la que finalizará la ruta (se debe enviar vacío en caso de no utilizarlo).

</td><td style="width: 293px;"><span style="color: #3366ff;">2022-02-28</span>

</td></tr><tr><td style="width: 146px;">hora\_fin

</td><td style="width: 370px;">Hora en la que finalizará la ruta (se debe enviar vacío en caso de no utilizarlo).

</td><td style="width: 293px;"><span style="color: #3366ff;">20:00:00</span>

</td></tr><tr><td style="width: 146px;">dias

</td><td style="width: 370px;">Días de la semana en que se ejecutará la salida de  
ruta, los valores aceptados son: Lu, Ma, Mi, Ju, Vi.  
Sa, Do; los días se separan con el signo “-”.

</td><td style="width: 293px;"><span style="color: #3366ff;">Lu-Mi-Vi-Sa</span>

</td></tr><tr><td style="width: 146px;">periodo

</td><td style="width: 370px;">Periodo en que se reprogramará la ruta, los valores  
aceptados son:  
1 = Todos los días  
2 = Todas las semanas  
3 = Todos los meses  
4 = Todos los años  
5 = Continuamente

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

</td></tr><tr><td style="width: 146px;">repetir

</td><td style="width: 370px;">Indica la frecuencia de días, semanas, meses o años en que se debe repetir la ruta.

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

</td></tr><tr><td style="width: 146px;">veces

</td><td style="width: 370px;">Número de veces que se debe cumplir la ruta antes de finalizarla (enviar 0 en caso de no utilizarlo).

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

</td></tr><tr><td style="width: 146px;">termina

</td><td style="width: 370px;">Indica cuando se debe considerar la ruta como  
finalizada. Los valores aceptados son:  
1 = Nunca, la ruta se repite indefinidamente  
2 = Después de n veces (la cantidad de repeticiones  
se especifica en el parámetro anterior “veces”)  
3 = Finaliza en una fecha y hora específica (la fecha  
se indica en “fecha\_fin” y “hora\_fin”)  
4 = Finaliza automáticamente al llegar al último  
punto.

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

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

</div></details><span style="color: #ff0000;">**Nota:** <span style="color: #ff0000;">La **definición** debe tener el mismo formato que el utilizado en el método </span> **createRoute**<span style="color: #ff0000;">.</span></span>

##### Solicitud de ejemplo:

```shell
curl --location --request POST 'https://api.service24gps.com/api/v1/updateScheduledRoute' \
--form 'apikey="25sdsd234234aa93sdsdsd37c70118e72"' \
--form 'token="wfszR/oPIQKjt5HT5NgjDnZ2SAZQ=="' \
--form 'id="1382123"' \
--form 'idruta="34534"' \
--form 'idactivo="245855"' \
--form 'nombre="Prueba nombre ruta"' \
--form 'definicion="{"distancia":80,"lugares":[{"id":"36589","tipo":1,"orden":"1","nombre":"Departamento 1","dist_pa":0,"latLng":"18.900479,-98.435602","fEstimada":"","tolerancia":0,"timeBetween":0,"distLleg":0,"orientacion":""}],"waypoints":{},"puntos":{},"rutas":[],"sinoGarmin":0,"useRoutePlaces":0}"' \
--form 'fecha_inicio="2022-02-27"' \
--form 'hora_inicio="15:30:00"' \
--form 'fecha_fin=""' \
--form 'hora_fin=""' \
--form 'dias="Lu-Mi-Vi-Sa"' \
--form 'periodo="2"' \
--form 'repetir="1"' \
--form 'veces="0"' \
--form 'termina="4"'
```

##### Respuesta de ejemplo:

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

# Eliminar ruta programada - deleteScheduledRoute

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

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/deleteScheduledRoute' \
--form 'apikey="25sdsd234234aa93sdsdsd37c70118e72"' \
--form 'token="wfszR/oPIQKjt5HT5NgjDnZ2SAZQ=="' \
--form 'idRuta="138225"'
```

##### Respuesta de ejemplo:

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

<span style="color: #ff0000;">**Nota:** Si en la respuesta de la solicitud aparece  **"status": 30700** es un error al obtener los datos.</span>

##### Respuesta de ejemplo:

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

# Crear ruta - createRoute

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

Permite crear la definición o serie de puntos que conforman 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: 146px; height: 41px;">Parámetros</th><th style="width: 370px; height: 41px;">Descripción</th><th style="width: 293px; height: 41px;">Ejemplo</th></tr><tr style="height: 41px;"><td style="width: 146px; height: 41px;">apikey</td><td style="width: 370px; height: 41px;">Llave de autorización para uso de los Servicios Web.</td><td style="width: 293px; 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: 370px; height: 41px;">Token devuelto por el método getToken.</td><td style="width: 293px; 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: 370px; height: 69px;">Nombre con el que se identificará la ruta dentro de la plataforma.

</td><td style="width: 293px; height: 69px;"><span role="presentation" style="padding-right: 0.1px;"><span style="color: #3366ff;">Prueba nombre ruta</span></span></td></tr><tr style="height: 338px;"><td style="width: 146px; height: 338px;">definición

</td><td style="width: 370px; height: 338px;">Definición de puntos, geocercas lineales, distancia, etc.

</td><td style="width: 293px; height: 338px;"><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;"> {</span>  
<span style="color: #3366ff;"> "id":"36589",</span>  
<span style="color: #3366ff;"> "tipo":1,</span>  
<span style="color: #3366ff;"> "orden":"1",</span>  
<span style="color: #3366ff;"> "nombre":"Departamento 1",</span>  
<span style="color: #3366ff;"> "dist\_pa":0,</span>  
<span style="color: #3366ff;"> "latLng":"18.900479,-98.435602",</span>  
<span style="color: #3366ff;"> "fEstimada":"",</span>  
<span style="color: #3366ff;"> "tolerancia":0,</span>  
<span style="color: #3366ff;"> "timeBetween":0,</span>  
<span style="color: #3366ff;"> "distLleg":0,</span>  
<span style="color: #3366ff;"> "orientacion":""</span>  
<span style="color: #3366ff;"> } \],</span>  
<span style="color: #3366ff;"> "waypoints":\[  
 \],</span>  
<span style="color: #3366ff;"> "puntos":\[  
 \],</span>  
<span style="color: #3366ff;"> "rutas":\[</span>  
<span style="color: #3366ff;"> \],</span>  
<span style="color: #3366ff;"> "sinoGarmin":0,</span>  
<span style="color: #3366ff;"> "useRoutePlaces":0</span>

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

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

</div></details><span style="color: #ff0000;">**Nota:** En caso de que no se requiera la información de **waypoints**, **puntos o rutas**; enviar como un objeto o arreglo vacío según corresponda.</span>

##### Solicitud de ejemplo:

```shell
curl --location --request POST 'https://api.service24gps.com/api/v1/updateRoute' \
--form 'apikey="25sdsd234234aa93sdsdsd37c70118e72"' \
--form 'token="wfszR/oPIQKjt5HT5NgjDnZ2SAZQ=="' \
--form 'id="1382123"' \
--form 'nombre="Prueba nombre ruta"' \
--form 'definicion="{"distancia":80,"lugares":[{"id":"36589","tipo":1,"orden":"1","nombre":"Departamento 1","dist_pa":0,"latLng":"18.900479,-98.435602","fEstimada":"","tolerancia":0,"timeBetween":0,"distLleg":0,"orientacion":""}],"waypoints":{},"puntos":{},"rutas":[],"sinoGarmin":0,"useRoutePlaces":0}"'

```

##### Respuesta de ejemplo:

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

# Listar rutas - getRoutes

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

Obtiene todas las rutas activas que pertenecen al usuario o 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/getRoutes' \
--form 'apikey="25sdsd234234aa93sdsdsd37c70118e72"' \
--form 'token="wfszR/oPIQKjt5HT5NgjDnZ2SAZQ=="'
```

##### Respuesta de ejemplo:

```JSON
{
    "status": 200,
    "data": [
         {
              "distancia": 80,
              "lugares": [
                  {
                      "id": "365891",
                      "tipo": 1,
                      "orden": "1",
                      "nombre": "Departamento",
                      "dist_pa": 0,
                      "latLng": "18.900479,-98.435602",
                      "fEstimada": "",
                      "tolerancia": 0,
                      "timeBetween": 0,
                      "distLleg": 0,
                      "orientacion": ""
                  },
                  {
                      "id": "395782",
                      "tipo": 1,
                      "orden": "3",
                      "nombre": "Punta del Cielo",
                      "dist_pa": 198,
                      "latLng": "19.027047,-98.207274",
                      "fEstimada": "",
                      "tolerancia": 0,
                      "timeBetween": 0,
                      "distLleg": 0,
                      "orientacion": ""
                  },
                  {
                      "id": "386863",
                      "tipo": 1,
                      "orden": "5",
                      "nombre": "Casa",
                      "dist_pa": 20511,
                      "latLng": "19.153059,-98.243021",
                      "fEstimada": "",
                      "tolerancia": 0,
                      "timeBetween": 0,
                      "distLleg": 0,
                      "orientacion": ""
                  }
              ],
              "waypoints": [],
              "puntos": [],
              "rutas": [],
              "sinoGarmin": 0,
              "useRoutePlaces": 0,
              "id": "2298289",
              "nombre": "PruebaRuta"
          }
    ]
}
```

<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: 558px;"><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;">distancia</td><td style="width: 392px;" width="351">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: 243px; height: 41px;">Entero</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">lugares</td><td style="width: 392px;" width="351">Información de los lugares que conforman la ruta.

</td><td style="width: 243px; height: 47px;">Arreglo de objetos</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">waypoints

</td><td style="width: 392px;" width="351">Puntos de referencia entre lugares de la ruta.

</td><td style="width: 243px; height: 47px;">Arreglo de objetos</td></tr><tr style="height: 35px;"><td style="height: 35px; width: 174px;">puntos

</td><td style="width: 392px;" width="351">Rutas calculadas a través de la API de Google.</td><td style="height: 35px; width: 243px;">Arreglo de objetos

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

</td><td style="width: 392px;" width="351">Geocercas de tipo ruta.

</td><td style="height: 35px; width: 243px;">Arreglo de objetos

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

</td><td style="width: 392px;" width="351">Indica si el dispositivo GPS tiene integrado un  
sistema con pantalla Garmin.

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

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

</td><td style="width: 392px;" width="351">Indica si debe usar los puntos de la ruta original o de la ruta programada.

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

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

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

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

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

</div></details>

# Actualizar ruta - updateRoute

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

Permite actualizar la definición o puntos que conforman una ruta.

<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="width: 809px; height: 946px;"><tbody><tr style="height: 41px;"><th style="width: 146px; height: 41px;">Parámetros</th><th style="width: 370px; height: 41px;">Descripción</th><th style="width: 293px; height: 41px;">Ejemplo</th></tr><tr style="height: 41px;"><td style="width: 146px; height: 41px;">apikey</td><td style="width: 370px; height: 41px;">Llave de autorización para uso de los Servicios Web.</td><td style="width: 293px; 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: 370px; height: 41px;">Token devuelto por el método getToken.</td><td style="width: 293px; height: 41px;"><span role="presentation" style="padding-right: 0.1px; color: #3366ff;">wfszR/oPIQKjt5HT5NgjDnZ2SAZQ==</span></td></tr><tr style="height: 47px;"><td style="width: 146px; height: 47px;">id</td><td style="width: 370px; height: 47px;">Identificador único de la ruta en el sistema.

</td><td style="width: 293px; height: 47px;"><span role="presentation" style="padding-right: 0.1px;"><span style="color: #3366ff;"> 1382123</span></span></td></tr><tr style="height: 69px;"><td style="width: 146px; height: 69px;">nombre</td><td style="width: 370px; height: 69px;">Nombre con el que se identificará la ruta dentro de la plataforma.

</td><td style="width: 293px; height: 69px;"><span role="presentation" style="padding-right: 0.1px;"><span style="color: #3366ff;">Prueba nombre ruta</span></span></td></tr><tr style="height: 338px;"><td style="width: 146px; height: 338px;">definición

</td><td style="width: 370px; height: 338px;">Definición de puntos, geocercas lineales, distancia, etc.

</td><td style="width: 293px; height: 338px;"><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;"> {</span>  
<span style="color: #3366ff;"> "id":"36589",</span>  
<span style="color: #3366ff;"> "tipo":1,</span>  
<span style="color: #3366ff;"> "orden":"1",</span>  
<span style="color: #3366ff;"> "nombre":"Departamento 1",</span>  
<span style="color: #3366ff;"> "dist\_pa":0,</span>  
<span style="color: #3366ff;"> "latLng":"18.900479,-98.435602",</span>  
<span style="color: #3366ff;"> "fEstimada":"",</span>  
<span style="color: #3366ff;"> "tolerancia":0,</span>  
<span style="color: #3366ff;"> "timeBetween":0,</span>  
<span style="color: #3366ff;"> "distLleg":0,</span>  
<span style="color: #3366ff;"> "orientacion":""</span>  
<span style="color: #3366ff;"> } \],</span>  
<span style="color: #3366ff;"> "waypoints":\[  
 \],</span>  
<span style="color: #3366ff;"> "puntos":\[  
 \],</span>  
<span style="color: #3366ff;"> "rutas":\[</span>  
<span style="color: #3366ff;"> \],</span>  
<span style="color: #3366ff;"> "sinoGarmin":0,</span>  
<span style="color: #3366ff;"> "useRoutePlaces":0</span>

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

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

</div></details><span style="color: #ff0000;">**Nota:** <span style="color: #ff0000;">La **definición** debe tener el mismo formato que el utilizado en el método </span> **createRoute**<span style="color: #ff0000;">.</span></span>

##### Solicitud de ejemplo:

```shell
curl --location --request POST 'https://api.service24gps.com/api/v1/updateRoute' \
--form 'apikey="25sdsd234234aa93sdsdsd37c70118e72"' \
--form 'token="wfszR/oPIQKjt5HT5NgjDnZ2SAZQ=="' \
--form 'id="1382123"' \
--form 'nombre="Prueba nombre ruta"' \
--form 'definicion="{"distancia":80,"lugares":[{"id":"36589","tipo":1,"orden":"1","nombre":"Departamento 1","dist_pa":0,"latLng":"18.900479,-98.435602","fEstimada":"","tolerancia":0,"timeBetween":0,"distLleg":0,"orientacion":""}],"waypoints":{},"puntos":{},"rutas":[],"sinoGarmin":0,"useRoutePlaces":0}"'

```

##### Respuesta de ejemplo:

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

# Eliminar ruta - deleteRoute

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

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/deleteRoute' \
--form 'apikey="25sdsd234234aa93sdsdsd37c70118e72"' \
--form 'token="wfszR/oPIQKjt5HT5NgjDnZ2SAZQ=="' \
--form 'idRuta="138225"'
```

##### Respuesta de ejemplo:

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

<span style="color: #ff0000;">**Nota:** Si en la respuesta de la solicitud aparece  **"status": 30700** es un error al obtener los datos.</span>

##### Respuesta de ejemplo:

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