PUT /users
Permite modificar usuarios en el sistema CNM.
PUT /users.json | Actualiza los campos especificados. |
PUT /users.json/12.json | Actualiza los campos especificados del usuario con id=12 |
El usuario se debe identificar mediante su id.
Campos modificables
Nombre | Tipo | Valores posibles | Descripción |
---|---|---|---|
login | Texto | Cualquiera | Login del usuario |
passwd | Texto | Cualquiera | Contraseña no cifrada del usuario |
descr | Texto | Cualquiera | Descripción del usuario |
timeout | Entero | Cualquiera | Timeout de sesión del usuario |
firstname | Texto | Cualquiera | Nombre del usuario |
lastname | Texto | Cualquiera | Apellidos del usuario |
Texto | Cualquiera | Correo electrónico del usuario | |
language | Texto | es_ES | en_US | Idioma de la interfaz gráfica del usuario |
profile | Texto | Cualquiera | Perfil al que pertenece el usuario |
role | Texto | Cualquiera | Rol del usuario |
Códigos de respuesta
Código | Descripción |
---|---|
200 | Resultado correcto |
400 | Error en la petición. |
401 | Error de autenticación. |
403 | Error por falta de permisos. |
500 | Error interno del servidor |
Valor devuelto
Devuelve un vector de datos indicando el código de respuesta de la operación y el id del usuario modificado.
Ejemplos
root@cnm:/var/www/html/onm/inc# curl -ki "https://localhost/onm/api/1.0/auth/token.json?u=admin&p=cnm123" HTTP/1.1 200 OK
Date: Mon, 22 Sep 2014 09:49:24 GMT
Server: Apache/2.2.16 (Debian) PHP/5.3.3-7 with Suhosin-Patch proxy_html/3.0.1 mod_ssl/2.2.16 OpenSSL/0.9.8o mod_perl/2.0.4 Perl/v5.10.1
X-Powered-By: PHP/5.3.3-7
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
:
Vary: Accept-Encoding
Content-Length: 59
Content-Type: text/html; charset=utf-8
{"status":0,"sessionid":"e3804d076a058a22ff6aaabfad6e5959"}
root@cnm:/var/www/html/onm/inc# curl -ki -g -H "Authorization: e3804d076a058a22ff6aaabfad6e5959" -X GET "https://localhost/onm/api/1.0/users.json" HTTP/1.1 200 OK
Date: Mon, 22 Sep 2014 09:49:58 GMT
Server: Apache/2.2.16 (Debian) PHP/5.3.3-7 with Suhosin-Patch proxy_html/3.0.1 mod_ssl/2.2.16 OpenSSL/0.9.8o mod_perl/2.0.4 Perl/v5.10.1
X-Powered-By: PHP/5.3.3-7
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
:
Vary: Accept-Encoding
Content-Length: 358
Content-Type: text/html; charset=utf-8
[{"id":"2","login":"test","descr":"Usuario de prueba","timeout":"1000","firstname":"Usuario","lastname":"De Prueba", "email":"
root@cnm:/var/www/html/onm/inc# curl -ki -H "Authorization: e3804d076a058a22ff6aaabfad6e5959" -X PUT "https://localhost/onm/api/1.0/users/2.json" -d "login=test2"
HTTP/1.1 200 OK
Date: Mon, 22 Sep 2014 09:51:45 GMT
Server: Apache/2.2.16 (Debian) PHP/5.3.3-7 with Suhosin-Patch proxy_html/3.0.1 mod_ssl/2.2.16 OpenSSL/0.9.8o mod_perl/2.0.4 Perl/v5.10.1
X-Powered-By: PHP/5.3.3-7
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
:
Vary: Accept-Encoding
Content-Length: 28
Content-Type: text/html; charset=utf-8
{"rc":0,"rcstr":"","id":"2"}
root@cnm:/var/www/html/onm/inc# curl -ki -g -H "Authorization: e3804d076a058a22ff6aaabfad6e5959" -X GET "https://localhost/onm/api/1.0/users.json" HTTP/1.1 200 OK
Date: Mon, 22 Sep 2014 09:51:47 GMT
Server: Apache/2.2.16 (Debian) PHP/5.3.3-7 with Suhosin-Patch proxy_html/3.0.1 mod_ssl/2.2.16 OpenSSL/0.9.8o mod_perl/2.0.4 Perl/v5.10.1
X-Powered-By: PHP/5.3.3-7
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
:
Vary: Accept-Encoding
Content-Length: 359
Content-Type: text/html; charset=utf-8
[{"id":"2","login":"test2","descr":"Usuario de prueba","timeout":"1000","firstname":"Usuario","lastname":"De Prueba", "email":"