Documentation

You are viewing documentation for the development version, it may be incomplete.
Join our translation project and help translate Zabbix documentation into your native language.

Sidebar

Become a monitoring expert!
Sign up for Zabbix training

userdirectory.create

Description

object userdirectory.create(object/array userDirectory)

This method allows to create new user directories.

This method is only available to Super admin user type.

Parameters

(object/array) User directories to create.

The method accepts user directories with the standard user directory properties.

Return values

(object) Returns an object containing the IDs of the created user directories under the userdirectoryids property. The order of the returned IDs matches the order of the passed user directories.

Examples

Creating a user directory

Create a user directory to authenticate users with StartTLS over LDAP.

Request:

{
           "jsonrpc": "2.0",
           "method": "userdirectory.create",
           "params": {
               "name": "LDAP API server #1",
               "host": "ldap://local.ldap",
               "port": "389",
               "base_dn": "ou=Users,dc=example,dc=org",
               "bind_dn": "cn=ldap_search,dc=example,dc=org",
               "bind_password": "ldapsecretpassword",
               "search_attribute": "uid",
               "start_tls": "1"
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "userdirectoryids": [
                   "2"
               ]
           },
           "id": 1
       }

Source

CUserDirectory::create() in ui/include/classes/api/services/CUserDirectory.php.