Is the Nx Cloud up? Visit our Status Page for the current health and performance of the Nx Cloud.

Status Page

Failed to create user through API.

Answered

Comments

5 comments

  • Permanently deleted user

    This account has all permissions

    The same error occurs with the admin account

     

    0
  • Andrey Terentyev
    • Network Optix team

    Hello,

    It seems to be a bug. Thank you for calling attention.

    JIRA-VMS-37244

    0
  • Reeve Hsu

    I am experiencing exactly the same issue. May I know when can it be fixed? Andrey Terentyev

    0
  • Andrey Terentyev
    • Network Optix team

    Gentlemen, the bug has been just registered. No term for now.

    0
  • Andrey Terentyev
    • Network Optix team

    Hello,

    The bug is in the web interface application, not in the API function.

    Here is a recommended way to test and use this API.

    1. According to the documentation "isOwner" should be false when creating a new user.

    2. Don't use server web interface for testing this API. Use a python script, for example this one

    https://github.com/networkoptix/nx_open_integrations/blob/master/python/examples/authentication/local_bearer.py

    here is what I modified in the script for creating a new user

    payload = {"name": "test1", "email": "", "type": "local", "isOwner": False, "isEnabled": True, "isHttpDigestEnabled": True, "password": "345sdfg1345awsdf"}
    get_method_header = create_header(primary_token)
    system_info = request_api(LOCAL_URL, f'/rest/v1/users', 'POST', verify=False,
                                  headers=get_method_header, json=payload)

    3. Make sure your session (i.e. token) is not older than 10 min.

    0

Please sign in to leave a comment.