KB Article #177563

Create an Account using RESTful API

Problem

Creating a Basic SecureTransport Account and User using cURL to access the RESTful API.

Resolution

  1. The first step is to create the SecureTransport Account
  2. # curl -X PUT -k -u Admin:Pass -H "Content-Type: application/json" -H "Accept: application/json" -d "{ "name" : "AccountName", "homeFolder" : "HomeFolder", "uid" : "UID", "gid" : "GID", "type" : "user" }" https://HostName:AdminPort/api/v1.2/accounts/AccountName
    

    Replace the following:

  • Admin = Replace with actual administrator name
  • Pass = Replace with actual administrator password
  • AccountName (occurs twice) = Replace with actual account name
  • HomeFolder = Replace with actual home folder, example /home/new-account
  • UID = Replace with actual UID, example: 12345
  • GID = Replace with actual GID, example: 23456
  • HostName = use localhost or hostname/IP of a remote SecureTransport server
  • AdminPort = Service port for the Admin, 444 by default


  • The second step is to create the SecureTransport User
    1. # curl -X PUT -k -u Admin:Pass -H "Content-Type: application/json" -H "Accept: application/json" -d "{ "name" : "AccountName", "authExternal" : "false", "locked" : "false", "failedAuthAttempts" : 0, "failedAuthMaximum" : 5, "passwordCredentials" : { "username" : "UserName", "forcePasswordChange" : false, "password" : "Password", "passwordExpiryInterval" : 90 } }" https://HostName:AdminPort/api/v1.2/accounts/AccountName/users/UserName
      

      Replace the following:

    • Admin = Replace with actual administrator name
    • Pass = Replace with actual administrator password
    • AccountName (occurs twice) = Replace with actual account name, use the same as step one
    • UserName (occurs twice) = Replace with actual user name (login name)
    • Password = Replace with actual login password
    • HostName = use localhost or hostname/IP of a remote SecureTransport server
    • AdminPort = Service port for the Admin, 444 by default


    Additional parameters (change if required):

    • authExternal = Defines whether the password is stored in an external directory (LDAP); possible values: true/false
    • locked = Defines whether the user is locked; possible values: true/false
    • failedAuthAttempts = Defines the current number of failed authentication attempts; possible values: integer number
    • failedAuthMaximum = Defines the maximum number of failed authentication attempts, before the account is locked; possible values: integer number
    • forcePasswordChange = Defines whether the user needs to change the password after the first authentication; possible values: true/false
    • passwordExpiryInterval = Defines the maximum number of days, before the password needs to be changed: possible values: integer number

    Additional Information

    To view the RESTful documentation, open this link with a web browser: https://HostName:AdminPort/api/v1.2/docs/index.htm...