KB Article #182653

REST API: Recreate Missing Administrator Accounts

Problem

Administrator accounts exist on both ST Server and ST Edge. On ST Server the administrator account can be backed up and restored via the Import/Export page in the Accounts menu in the Administrator's tool or the xml_import and xml_export command line tools in the <FILEDRIVEHOME>/bin folder. On the ST Edge, these tools are not available.

Resolution

On ST Edge and ST Server, all administrator accounts can be exported via the REST API.

To access it, first, go to


https://your_st_host:admin_service_port/api/v2.0/docs/index.html


Once you authenticate, you will be presented with the ST Swagger UI, where you can construct your API calls.

Exporting all administrator accounts is relatively straightforward. Go to /administrators GET method, select "Try it out" and "Execute". The result is in JSON format and looks like this:


{
  "resultSet": {
    "returnCount": 3,
    "totalCount": 3
  },
  "result": [
    {
      "loginName": "admin",
      ..............
      },
      "passwordCredentials": {
        "password": "",
        ..............
      }
    },
    {
      "loginName": "dbsetup",
      ..............
      },
      "passwordCredentials": {
        "password": "",
        ..............
      }
    },
    {
      "loginName": "test_admin",
      ..............
      },
      "passwordCredentials": {
        "password": "",
        ..............
      }
    }
  ]
}


Copy the text from within the "result": [].


Remove the already existing accounts like "admin" and "dbsetup".


Add password strings within the double quotation marks ("") for the "password" parameter and save this JSON text.


Then if one or more admin accounts from this list are deleted in the future, or the server is reinstalled, you can recreate each via a separate request to the /administrators POST API resource using the saved JSON text of the individual account.