此方法允许创建新的用户。

    Description

    object user.create(object/array **users**)

    This method allows to create new users.

    Parameters

    (object/array) 要创建的用户.

    (object/array) Users to create.

    Additionally to the , the method accepts the following parameters.

    ParameterTypeDescription
    passwd
    (required)
    stringUser’s password.
    usrgrps
    (required)
    arrayUser groups to add the user to.

    The user groups must have the usrgrpid property defined.
    user_mediasarrayMedias to create for the user.

    返回值

    返回一个包含创建值的ID的对象映射 userids 属性。返回的ID的顺序与传递的用户的顺序相匹配。

    Return values

    (object) Returns an object containing the IDs of the created users under the userids property. The order of the returned IDs matches the order of the passed users.

    Examples

    创建一个用户

    Creating a user

    Create a new user, add him to a user group and create a new media for him.

    Request:

    Response:

    1. {
    2. "jsonrpc": "2.0",
    3. "12"
    4. ]
    5. },
    6. "id": 1

    参考

    CUser::create() in frontends/php/include/classes/api/services/CUser.php.