Hi!
I try to add users to an existing group by using ZABBIX API (V1.8).
The UserID is: 104
The GroupID is: 32
API call is:
Also tried:
Also tried but encountered an error msg:
Return Code:
But the user still belongs to no group.
Looking forward for our ideas, Marcus
I try to add users to an existing group by using ZABBIX API (V1.8).
The UserID is: 104
Code:
mysql> select * from users; +--------+-------------+----------------------+-------------------------------------------------------+----------------------------------+----------------------------------------------------------------------+-----------+------------+-------+---------+------+-------------+----------------+---------------+---------------+---------------+ | userid | alias | name | surname | passwd | url | autologin | autologout | lang | refresh | type | theme | attempt_failed | attempt_ip | attempt_clock | rows_per_page | +--------+-------------+----------------------+-------------------------------------------------------+----------------------------------+----------------------------------------------------------------------+-----------+------------+-------+---------+------+-------------+----------------+---------------+---------------+---------------+ ... | 104 | strswe80 | xxxxx | xxxxxx | 5fce1b3e34b520afeffb37ce08c7cd66 | | 0 | 3600 | en_gb | 120 | 1 | css_ob.css | 0 | | 0 | 25 | +--------+-------------+----------------------+-------------------------------------------------------+----------------------------------+----------------------------------------------------------------------+-----------+------------+-------+---------+------+-------------+----------------+---------------+---------------+---------------+
Code:
mysql> select * from usrgrp; +----------+---------------------------------+------------+--------------+------------+------------+ | usrgrpid | name | gui_access | users_status | api_access | debug_mode | +----------+---------------------------------+------------+--------------+------------+------------+ .... | 32 | Dez-4_Users | 0 | 0 | 0 | 0 | ..... +----------+---------------------------------+------------+--------------+------------+------------+ 10 rows in set (0.01 sec)
Code:
{"jsonrpc":"2.0","method":"usergroup.massUpdate","params":[{"usrgrpids": ["32"],"userids": ["104"]}],"auth":"f513ea5b1f48f7a9f3dd8c67d22db08b","id":0}
Code:
{"jsonrpc":"2.0","method":"usergroup.massUpdate","params":{"usrgrpids": ["32"],"userids": ["104"]},"auth":"f513ea5b1f48f7a9f3dd8c67d22db08b","id":0}
Code:
{"jsonrpc":"2.0","method":"usergroup.massAdd","params":[{ "usrgrpids":"32", "userids":"104"}],"auth":"60ffc74bc21f8044b35bc631660ad46c","id":0}
Code:
{"jsonrpc":"2.0","method":"usergroup.massAdd","params":{"usrgrpids": ["32"],"userids": ["104"],},"auth":"1d9f4492dee9f53244bd8e1340fa3b2f","id":0}
Code:
HTTP/1.1 200 OK
{"jsonrpc":"2.0","result":true,"id":0}
Looking forward for our ideas, Marcus
Comment