PUT /system-ms/department/v1/{departmentId}

Update the details of a department. Only Admin users can use this request.

To modify the details of a department:
  1. Perform the authentication and login to the API. For more information, see POST /auth/login.

  2. Use PUT /system-ms/department/v1/{departmentId} to send an HTTP PUT request.

  3. Click Try it Out option.

  4. Set the parameters as listed in the following table.

    Parameter Name

    Sample Value

    Supported Value

    Description

    departmentId

    departmentId

    integer 32

    Indicates the name of the department.
    Note:

    This parameter is mandatory.

  5. Under Request body select application/json from drop-down list.

  6. Enter the request body parameter values as follows:
    Note: The highlighted parameters are mandatory and it must be configured in the request body.
    {
      "departmentId": 0,
      "departmentName": "string",
      "parentDepartmentId": 0,
      "location": {
        "locationId": 0,
       "locationName": "string",
        "description": "string"
      },
      "description": "string",
      "udf1": "string",
      "udf2": "string",
      "udf3": "string",
      "udf4": "string",
      "udf5": "string",
      "udf6": "string",
      "udf7": "string",
      "udf8": "string",
      "udf9": "string",
      "udf10": "string"
    }
    The following table describes the request body parameters.
    Parameter Name Sample Value Description

    >departmentId

    Integer (int32)

    -

    >departmentName

    HR

    Enter the Department Name.

    A department with the entered department name will be added in the tree structure, or an existing selected department will be renamed.

    When renaming a department, if the department or its offspring department(s) has belonging users and these users are created on CMG, then user update request will be sent to CMG with the new department info for these users. If the target CMG does not support creating new department automatically, error message will be displayed.

    If there is a large number of belonging users, it will take some time to update these users on CMG.

    Format:
    • Up to 64 alphanumerical and special characters.

    • The characters ", *, ?, \, < and > are not allowed.

    Example:
    • HR
    • EBC

    >parentDepartmentId

    Integer (int32)

    Select the Parent Department, that is, the full path to where the department will be placed in the tree structure. To move a department in the department tree, select a new parent department.

    When changing the parent department of a department, if the department or its offspring department(s) has belonging users and these users are created on CMG, then user update request will be sent to CMG with the new department info for these users. If the target CMG does not support creating new department automatically, error message will be displayed.

    If there is a large number of belonging users, it will take some time to update these users on CMG.

    If the change will cause the depth of any department in the organization tree to exceed the maximum depth(50) limit, an error message will be displayed.

    Options: A list of available parent departments.

    Default is the department that was selected when Add was clicked.

    >location

    >>description

    Stockholm

    Select the Location of the department. The location can, for example, be a geographical area or a building. A list of available locations defined in the Location task.

    Options:
    • Stockholm
    • Main Building

    >>locationId

    Integer (int32)

    -

    >>locationName

    String

    Enter the name of the location. A location can, for example, be a geographical or a building. Subsystems and departments are associated to locations. Up to 50 alphanumerical characters. The characters ", *, ?, , &, ', <, > and comma (,) are not allowed.
    Note: This parameter is mandatory.

    >>description

    String

    Enter a Description of the Location. The description is used to differentiate the location from other locations.

    Format:
    • Up to 255 alphanumerical characters.

    • All the special characters except " and \ are allowed.

    Maximum Length: 255

    Minimum Length: 0

    >>cmgCustomerGroup

    String

    Enter the CMG Customer Group number that the location belongs to in CMG Server, that is, the value for the customer group ID from the CMG Server. A customer group makes it possible for companies to subdivide their resources or make it possible for several smaller companies to share the same system. Each subdivision or company is defined as a customer.

    Format: 1 to 3 digits.

    Note: If no value is entered, the system will use value 1 as default. This means that the location will belong to a common group for undefined CMG Customer Groups.

    >description

    Stockholm

    Select the Location of the department. The location can, for example, be a geographical area or a building. A list of available locations defined in the Location task.

    Options:
    • Stockholm
    • Main Building

    >udf1

    String

    -

    >udf2

    String

    -

    >udf3

    String

    -

    >udf4

    String

    -

    >udf5

    String

    -

    >udf6

    String

    -

    >udf7

    String

    -

    >udf8

    String

    -

    >udf9

    String

    -

    >udf10

    String

    -

  7. Click on Execute to generate the request URL.

    Request URL:
    https://<IP_Address>:<PORT>/system-ms/department/v1/1
    The following table lists the expected responses.

    Response Type

    Value

    Schema

    Valid Response

    200 OK

    {
      "departmentId": 0,
      "departmentName": "string",
      "parentDepartmentId": 0,
      "location": {
        "locationId": 0,
        "locationName": "string",
        "description": "string"
      },
      "description": "string",
      "udf1": "string",
      "udf2": "string",
      "udf3": "string",
      "udf4": "string",
      "udf5": "string",
      "udf6": "string",
      "udf7": "string",
      "udf8": "string",
      "udf9": "string",
      "udf10": "string"
    }

    Error Response

    400 Bad Request

    Not applicable

    401 Authentication Failure

    Not applicable

    403 Forbidden

    Not applicable

    404 Not found

    Not applicable