Create a User

The Create a User method creates a User. The request should be provided with API token (see  API Token Authentication).

POST /api/vendor/v1/users.json?api_token={}

Arguments

Name

Parameter Type

Data type

Required/Optional

Description

api_tokenquerystringRequiredAPI token of the manager who perform the operation (see API Token Authentication).

first_name

form

string

Required

A first name for the user.

middle_name

form

string

OptionalA middle name for the user.
last_name

form

string

Required

A last name for the user.
password

form

string

Required

A password for the user. The requirements to the password are set in the Password settings in the ActivePlatform. Operator Control Panel.
email

form

string

Required

An email of the user, which will be used as a login.
custom_attributes[][key]

form

string

Depends on ID of the account type

A list of additional attributes (see Managing attributes in the ActivePlatform. Operator Control Panel).

The key that is used to determine the element in API (see Creating an attribute in the ActivePlatform. Operator Control Panel).

custom_attributes[][value]

form

Depends on attributeDepends on ID of the account type
A value of the attribute.

Response model

Name

Data type

Description

id

integer

A unique identification number of the user.

first_name

string

The first name for the user.

middle_name

string

The middle name for the user.

last_name

string

The last name for the user.

email

string

An email of the user, which is used as a login.

status

string

A user's status for all Accounts, to which it was linked: active or inactive.

custom_attributes

array

A list of additional attributes (see Managing attributes in the ActivePlatform. Operator Control Panel):

  • name - a name of the attribute;

  • value - a value of the attribute.

created_at

date

A date and time of the user's creation.

updated_at

date

A date and time of the last update of the user information.

Request example

POST http://billing.activeplatform.com:80/api/vendor/v1/users.json?api_token=654321
{
  "first_name": "John",
  "middle_name": "",
  "last_name": "Doe",
  "password": "N;T@o;y!4TNqlV",
  "email": "john.doe8@activeplatfrom.com",
  "custom_attributes": [
     {
       "key": "age",
       "value": "21"
     }
  ]
}

Response example

If the User was successfully created, the method returns:

{
  "id": 2021053,
  "first_name": "John",
  "middle_name": "",
  "last_name": "Doe",
  "email": "john.doe8@activeplatfrom.com",
  "status": "active",
  "custom_attributes": [
    {
      "name": "Age",
      "value": "21"
    }
  ],
  "created_at": "2016-10-07T14:15:47.746+03:00",
  "updated_at": "2016-10-07T14:15:47.746+03:00"
}

If the required data was missed, the method returns the mistake, for example:

{
	"error": "password is missing"
}