/api/users/create

Creates new user.

This resource is available only for Global admin or Domain admin.

Resource Information

Request Parameters

ParameterDetailExample
data

Form contents to submit in following JSON format:

NameDescription
domain_idDomain identifier
usernameUsername
emailUser email address
firstNameUser first name
middleNameUser middlename
lastNameUser last name
info(Optional) User detail information
timeZone(Optional) User time zone
locale(Optional) User locale - code of supported language
roles

(Optional) Array containing all user roles where each role has following structure:

NameDescription
roleRole name - please see list of supported values
groups

(Optional) Array containing all user groups where user belongs. Each group has following structure:

NameDescription
idUser group identifier
nameUser group name
parameters(Optional] Array containing all user parameters.
addRequestIdToResponsereturns "PASSWORD_SET" user request ID together with user ID in format USER_ID;REQUEST_ID
sendNotificationvalue: true/false. Will send registration email if SMTP server is set
requestPinvalue: true/false. Will generate 4 digit pin instead of request_code


{
  "domain_id": 123,
  "username": "myusername",
  "email": "myusername@example.com",
  "firstName": "John",
  "middleName": "Middle", 
  "lastName": "Doe",
  "info": "I'm pretty cool",
  "timeZone": "Europe/Prague",
  "locale": "cs",
  "roles": [
    {
      "role": "DATA_ADMIN"
    },
    {
      "role": "SCHEMA_ADMIN"
    }
  ],
  "groups": [
    {
      "id": "56",
      "name": "My User Group nr.1"
    }
  ],
  "parameters": [
	{
	  "key" : "nameofparam",
	  "value" : "valueofparam"
	}
  ]
}

Sample Request / Response

Using curl:

curl -H "Authorization: OAuth realm=\"https://service.belladati.com/\", oauth_consumer_key=\"myConsumer\", oauth_token=\"mh7an9dkrg59\", oauth_timestamp=\"135131231\", oauth_nonce=\"randomString\""  -d "data={\"domain_id\":123,\"username\":\"myusername\",\"email\":\"myusername@example.com\",\"firstName\":\"John\",\"lastName\":\"Doe\"}" https://service.belladati.com/api/users/create

When the form has been submitted successfully, the server replies with an HTTP status code of 200 and a body that contains ID of new user.


  • No labels