# Crea o actualiza un usuario - setUser

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

Crea o actualiza un usuario.

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

<div><table class="table" style="height: 640px; width: 810px;"><tbody><tr style="height: 41px;"><td style="width: 198px; height: 41px;">**Parámetros**</td><td style="width: 310px; height: 41px;">**Descripción**</td><td style="width: 26px; height: 41px;">**<span role="presentation" style="padding-right: 0.1px;"> </span>**</td><td style="width: 276px; height: 41px;">**<span role="presentation" style="padding-right: 0.1px;">Ejemplo</span>**</td></tr><tr style="height: 57px;"><td style="width: 198px; height: 57px;">apikey</td><td style="width: 310px; height: 57px;">**(Requerido)** Llave de autorización para uso de los Servicios Web.</td><td style="width: 26px; height: 57px;"><span role="presentation" style="padding-right: 0.1px; color: #3366ff;"> </span></td><td style="width: 276px; height: 57px;"><span role="presentation" style="padding-right: 0.1px; color: #3366ff;">25sdsd234234aa93sdsdsd37c70118e72</span></td></tr><tr style="height: 41px;"><td style="width: 198px; height: 42px;">token</td><td style="width: 310px; height: 42px;">**(Requerido)** Token devuelto por el método [**getToken**](https://docs.redgps.com/books/webservice/page/metodo-de-autenticacion-gettoken-7ef).</td><td style="width: 26px; height: 42px;"><span style="color: #3366ff;"> </span></td><td style="width: 276px; height: 42px;"><span style="color: #3366ff;">wfszR/oPIQKjt5HT5NgjDnZ2SAZQ==</span></td></tr><tr style="height: 58px;"><td style="width: 198px; height: 58px;"><div><div>idusuario</div></div></td><td style="width: 310px; height: 58px;">**(Opcional)** Identificador único del usuario. **Sólo cuando se va actualizar.**</td><td style="width: 26px; height: 58px;"><span style="color: #3366ff;"> </span></td><td style="width: 276px; height: 58px;"><span style="color: #3366ff;">1</span></td></tr><tr style="height: 41px;"><td style="width: 198px; height: 41px;"><div><div><div><div>nombre</div></div></div></div></td><td style="width: 310px; height: 41px;">**(Requerido)** Nombre que va tener el usuario.</td><td style="width: 26px; height: 41px;"><span style="color: #3366ff;"> </span></td><td style="width: 276px; height: 41px;"><span style="color: #3366ff;">User 111</span></td></tr><tr style="height: 41px;"><td style="width: 198px; height: 41px;">user</td><td style="width: 310px; height: 41px;">**(Requerido)** Usuario con el que se va autenticar.</td><td style="width: 26px; height: 41px;"><span style="color: #3366ff;"> </span></td><td style="width: 276px; height: 41px;"><span style="color: #3366ff;">user\_111</span></td></tr><tr style="height: 41px;"><td style="width: 198px; height: 41px;">password</td><td style="width: 310px; height: 41px;">**(Requerido)** Contraseña para el usuario.</td><td style="width: 26px; height: 41px;"><span style="color: #3366ff;"> </span></td><td style="width: 276px; height: 41px;"><span style="color: #3366ff;">123456</span></td></tr><tr style="height: 41px;"><td style="width: 198px; height: 41px;">email</td><td style="width: 310px; height: 41px;">**(Requerido)** Correo electrónico del usuario.</td><td style="width: 26px; height: 41px;"><span style="color: #3366ff;"> </span></td><td style="width: 276px; height: 41px;"><span style="color: #3366ff;">user111@gmail.com</span></td></tr><tr style="height: 58px;"><td style="width: 198px; height: 58px;">idcliente</td><td style="width: 310px; height: 58px;">**(Requerido)** Identificador único del cliente al que va pertenecer el usuario.</td><td style="width: 26px; height: 58px;"><span style="color: #3366ff;"> </span></td><td style="width: 276px; height: 58px;"><span style="color: #3366ff;">11</span></td></tr><tr style="height: 80px;"><td style="width: 198px; height: 80px;">idzona\_horaria</td><td style="width: 310px; height: 80px;">**(Opcional)** Identificador único de la zona horaria.  
\- Obtener los tipos en el método **[getTimeZone](https://docs.redgps.com/books/webservice/page/obtiene-el-listado-de-zonas-horarias-gettimezone).**

</td><td style="width: 26px; height: 80px;"><span style="color: #3366ff;"> </span></td><td style="width: 276px; height: 80px;"><span style="color: #3366ff;">1</span></td></tr><tr style="height: 41px;"><td style="width: 198px; height: 41px;">parar\_motor</td><td style="width: 310px; height: 41px;">**(Opcional)** Activar comando de paro de motor.  
1 = Si  
0 = No</td><td style="width: 26px; height: 41px;"><span style="color: #3366ff;"> </span></td><td style="width: 276px; height: 41px;"><span style="color: #3366ff;">0</span></td></tr><tr style="height: 41px;"><td style="width: 198px; height: 41px;">enviar\_sms</td><td style="width: 310px; height: 41px;">**(Opcional)** Enviar comando y alertas por SMS.  
1 = Si  
0 = No</td><td style="width: 26px; height: 41px;"><span style="color: #3366ff;"> </span></td><td style="width: 276px; height: 41px;"><span style="color: #3366ff;">0</span></td></tr><tr style="height: 58px;"><td style="width: 198px; height: 58px;">cargar\_geocercas\_al\_inicio</td><td style="width: 310px; height: 58px;">**(Opcional)** Cargar geocercas al inicio de cada sesión.  
1 = Si  
0 = No</td><td style="width: 26px; height: 58px;"><span style="color: #3366ff;"> </span></td><td style="width: 276px; height: 58px;"><span style="color: #3366ff;">1</span></td></tr></tbody></table>

</div></details>##### Solicitud de ejemplo crear un usuario:

```shell
curl --location 'https://api.service24gps.com/api/v1/setUser' \
--form 'apikey="25sdsd234234aa93sdsdsd37c70118e72"' \
--form 'token="wfszR/oPIQKjt5HT5NgjDnZ2SAZQ=="' \
--form 'nombre="User 111"' \
--form 'user="user_111"' \
--form 'password="123456"' \
--form 'email="user111@gmail.com"' \
--form 'idcliente="11"' \
--form 'idzona_horaria="1"' \
--form 'parar_motor="0"' \
--form 'enviar_sms="0"' \
--form 'cargar_geocercas_al_inicio="0"'
```

##### Respuesta de ejemplo:

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

##### Solicitud de ejemplo editar un usuario:

```shell
curl --location 'https://api.service24gps.com/api/v1/setUser' \
--form 'apikey="25sdsd234234aa93sdsdsd37c70118e72"' \
--form 'token="wfszR/oPIQKjt5HT5NgjDnZ2SAZQ=="' \
--form 'idusuario="1"' \
--form 'nombre="User 111"' \
--form 'user="user_111"' \
--form 'password="123456"' \
--form 'email="user111@gmail.com"' \
--form 'idcliente="11"' \
--form 'idzona_horaria="1"' \
--form 'parar_motor="0"' \
--form 'enviar_sms="0"' \
--form 'cargar_geocercas_al_inicio="0"'
```

##### Respuesta de ejemplo:

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

<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: 94px;"><tbody><tr><td style="width: 174px;">**Campo**</td><td style="width: 392px;">**Descripción**

</td><td style="width: 243px;">**Formato**</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">id</td><td style="width: 392px; height: 47px;">Identificador único del usuario

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

</div></div></details>