Ad Widget

Collapse

Changing user type via API

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • seky
    Junior Member
    • Sep 2016
    • 2

    #1

    Changing user type via API

    Hello,

    I am trying to create a new user into Zabbix enviroment (3.2 version) through Zabbix API something like that:

    {
    "jsonrpc": "2.0",
    "method": "user.create",
    "params": {
    "name": "Jakub",
    "surname": "Smith",
    "alias": "smith",
    "passwd": "Doe123",
    "usrgrps": [
    {
    "usrgrpid": "7"
    }
    ]
    },
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
    }

    All is working and user was created, but how to change User type (Zabbix User, Zabbix Admin, Zabbix Super Admin) via API, is that possible? I can change groups for user, where belong (Guests or Administrators), through the web interface I can change User type per user and this is what I want. By default I want have root as Zabbix Super Admin, other admins as Zabbix Admin and guests as Zabbix User.

    Thanks for your reply and have a nice day.
  • Colttt
    Senior Member
    Zabbix Certified Specialist
    • Mar 2009
    • 878

    #2
    please use code-tags!

    as i can see here https://www.zabbix.com/documentation...ce/user/update and here https://www.zabbix.com/documentation...er/object#user
    it must be possible with the following request:

    update:
    Code:
    {
        "jsonrpc": "2.0",
        "method": "user.updateprofile",
        "params": {
            "name": "John",
            "lastname": "Doe",
            "type": "3"
        },
        "auth": "038e1d7b1735c6a5436ee9eae095879e",
        "id": 1
    }
    create:
    Code:
    {
      "jsonrpc": "2.0",
      "method": "user.create",
      "params": {
        "name": "Jakub",
        "surname": "Smith",
        "alias": "smith",
        "passwd": "Doe123",
        "type": "3",
        "usrgrps": [
          {
    	"usrgrpid": "7"
          }
        ]
      },
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
    }
    Debian-User

    Sorry for my bad english

    Comment

    Working...