Managing CTERA Portal Users > Creating a New Portal User
Creating a New Portal User
Create a new CTERA Portal user.
API
admin/api/users
URI
{BASE_URL}/users
HTTP Method
POST
Request Content-Type
application/xml
Request Body
The PortalUser object in XML format. For example:
<obj>
  <att id="name">
    <val>add</val>
  </att>
  <att id="param">
    <obj class="PortalUser">
      <att id="email">
        <val>user@company.cc</val>
      </att>
      <att id="firstName">
        <val>fname</val>
      </att>
      <att id="lastName">
        <val>lname</val>
      </att>
      <att id="name">
        <val>username</val>
      </att>
      <att id="password">
        <val>password</val>
      </att>
    </obj>
  </att>
</obj>
Response body
<val>teamPortals/portal_name/users/username</val>
Expected Response status
200 OK
Object Method
add
The request body:
email – Mandatory: The email address of the user to add to the portal.
firstName – Mandatory: The first name of the user to add.
lastName – Mandatory: The last name of the user to add.
name – A name to identify the user in the portal.
password – Mandatory: The password for the user. The password is not encrypted. The password must include at least 3 of the following character types: uppercase and lowercase characters, digits and special characters.
The response body:
portal_name – The name of the portal, logged in to.
username – The name of the user created.
Java Example
StringBuilder xml = new StringBuilder();
builder.append("<obj class=\"PortalUser\">");
builder.append("<att id=\"accountStatus\"><val>active</val></att>");
builder.append("<att id=\"email\"><val>jsmith@acme.com</val></att>");
builder.append("<att id=\"firstName\"><val>John</val></att>");
builder.append("<att id=\"lastName\"><val>Smith</val></att>");
builder.append("<att id=\"name\"><val>jsmith</val></att>");
builder.append("<att id=\"password\"><val>johnpassword123</val></att>");
builder.append("</obj>");
invokeMethod(httpClient, baseUrl+ "/users", "add", xml.toString())