Ad Widget

Collapse

Zabbix API: user.update method to disable user media (email)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mguarienti
    Junior Member
    • Dec 2021
    • 1

    #1

    Zabbix API: user.update method to disable user media (email)

    Hi!
    I'm developing an integration where an access to the Zabbix API must disable the client's media (in this case the email). All the authentication part is ready but I'm not able to use the user.update method. The idea is to find the 'sendto' with the desired email and change the 'active' to 1, which disables the media.

    Exemple method user.get:

    Code:
    {
    "jsonrpc":"2.0",
    "result":[
    {
    "userid":"143",
    "alias":"john",
    "name":"John",
    "surname":"Doe",
    "url":"",
    "autologin":"0",
    "autologout":"0",
    "lang":"pt_BR",
    "refresh":"30s",
    "type":"1",
    "theme":"default",
    "attempt_failed":"0",
    "attempt_ip":"xxxx:yyyy:x:yyyy::x",
    "attempt_clock":"1640115857",
    "rows_per_page":"50",
    "medias":[
    {
    "sendto":[
    "[email protected]"
    ],
    "active":"0"
    },
    {
    "sendto":[
    "[email protected]"
    "[email protected]"
    ],
    "active":"1"
    }
    ]
    }
    ],
    "id":1
    }
    How can I use the user.update method to change the value of the field "active":"0" to "active":"1" in "sendto":["[email protected]"]?

    ---------------

    Exemple - Renaming user:

    Code:
    {
    "jsonrpc":"2.0",
    "method":"user.update",
    "params":{
    "userid":"1",
    "name":"John",
    "surname":"Doe"
    },
    "auth":"038e1d7b1735c6a5436ee9eae095879e",
    "id":1
    }


    Last edited by mguarienti; 23-12-2021, 13:53.
Working...