Create securityUser elements from JSON input

You can pass a single JSON object to create a single element, or a JSON array of securityUser JSON objects to create multiple elements. If you create a single element, the response includes the URI of the new element in the Location response header, and the response body includes one securityUser JSON object with the format specified by the format parameter. If you create multiple elements, the response includes a JSON array of securityUser JSON objects with the specified format in an order that corresponds to the order of the input data. If no format is specified, the "detail" format will be used by default. If creating a large number of elements in a single request, it is recommended to use the "list" or "name" formats for better performance, when the use case allows it.

Request

POST http://{hostname}:{port}
  /users/?{parameters}
Accept: application/json
Content-Type: application/json
Table 1. Request parameters
Parameter Type Required Description
format string false One of the format options; this parameter determines what information is included in the JSON response. If not specified, or if an unrecognized value is specified, the default format of "detail" will be used.
Table 2. Header parameters
Parameter Type Required Description
Content-Type application/json true
Accept application/json true
For the format parameter, use one of the following format options:
name
id, name, actualName, displayName
list
id, name, actualName, email and AuthenticationRealm
detail
Identical to 'list' format
profile
id, name, actualName, displayName, email, phone, profileId, and backupUsers
For details about the full JSON that the server returns when you select one of these formats, see the related resource: users resource.

Example

curl -k -u jsmith:passwd  
  "http://myserver.example.com:8080/users/" 
  -X PUT
  -H "Accept: application/json"
  -H "Content-Type: application/json"
  -d @newUser.json

Example JSON request

{
  "name": "exampleuser",
  "password": "exampleuser",
  "actualName": "Example User",
  "email": "exampleuser@example.com",
  "isAuthorized": false
}

Example JSON response

{
  "id": "6fe5286a-75d8-4b4b-ad2f-d9eb7d7ba0d2",
  "name": "exampleuser",
  "actualName": "Example User",
  "email": "exampleuser@example-organization.com",
  "enabled": true,
  "authenticationRealm": {
    "id": "00000000-0000-0000-0000-000000000001",
    "name": "Internal Authentication",
    "description": "Internal Authentication",
    "enabled": true,
    "ghostedDate": 0,
    "allowedAttempts": 5,
    "sortOrder": 0,
    "loginModuleClassName": "com.urbancode.security.authentication.internal.InternalLoginModule",
    "readOnly": false,
    "authorizationRealm": {
      "id": "00000000-0000-0000-0000-000000000000",
      "name": "Internal Authorization",
      "description": "Internal Authorization",
      "ghostedDate": 0,
      "authorizationModuleClassName": "com.urbancode.security.authorization.internal.InternalAuthorizationModule",
      "version": 0
    },
    "version": 0
  },
  "isAuthorized": false
}