پرش به مطلب اصلی

Create New User by Admin API

POST /createNewUserByAdmin

Description

This API endpoint allows an admin to create a new user by providing details such as group ID, reseller ID, name, username, email, devices, country, and phone number. The admin can manage user creation within specific groups and reseller accounts.

Request Body

The request utilizes GraphQL to perform the createNewUserByAdmin mutation.

Mutation:

mutation createNewUserByAdmin ($groupId: Int, $resellerId: Int, $firstName: String, $lastName: String, $userName: String, $email: String, $devices: String, $country: String, $phone: String) {
createNewUserByAdmin (
groupId: $groupId,
resellerId: $resellerId,
firstName: $firstName,
lastName: $lastName,
userName: $userName,
email: $email,
devices: $devices,
country: $country,
phone: $phone
) {
id
email
username
resellerId
role
enabled
radAccess
radAccessClear
createdAt
updatedAt
}
}

Variables:

{
"groupId": 0,
"resellerId": 0,
"firstName": "<First_Name>",
"lastName": "<Last_Name>",
"userName": "<Username>",
"email": "<Email>",
"devices": "<Devices>",
"country": "<Country>",
"phone": "<Phone>"
}
  • groupId (Int): The ID of the group the new user will belong to.
  • resellerId (Int): The ID of the reseller associated with the new user.
  • firstName (String): The first name of the new user.
  • lastName (String): The last name of the new user.
  • userName (String): The username for the new user.
  • email (String): The email address of the new user.
  • devices (String): A string representing the devices associated with the new user.
  • country (String): The country where the new user is located.
  • phone (String): The phone number of the new user.

Response:

  • Success (200 OK):

    {
    "data": {
    "createNewUserByAdmin": {
    "id": "<User_ID>",
    "email": "<Email>",
    "username": "<Username>",
    "resellerId": "<Reseller_ID>",
    "role": "<User_Role>",
    "enabled": <Enabled_Status>,
    "radAccess": "<Rad_Access>",
    "radAccessClear": "<Rad_Access_Clear>",
    "createdAt": "<Creation_Timestamp>",
    "updatedAt": "<Update_Timestamp>"
    }
    }
    }
    • id (Int): The unique identifier of the created user.
    • email (String): The email address of the user.
    • username (String): The username of the user.
    • resellerId (Int): The ID of the reseller associated with the user.
    • role (String): The role assigned to the user.
    • enabled (Boolean): The status of whether the user is enabled or not.
    • radAccess (String): The radius access configuration for the user.
    • radAccessClear (String): The cleared radius access configuration for the user.
    • createdAt (String): The timestamp when the user was created.
    • updatedAt (String): The timestamp when the user was last updated.
  • Error (4XX/5XX):

    • Appropriate error messages and status codes will be returned in cases of invalid data, missing required fields, or server errors.

Note:

Ensure that all required fields are provided and correctly formatted according to the platform's specifications. The admin creating the user must have the necessary permissions to assign the user to specific groups and resellers.