Create An Account

Description

This API allows users to create new accounts

URL Path

/account

Method

POST

HTTP header parameters

Authorization

The authentication token of the caller

REQUIRED

This header should have the following format: Bearer [

Example: Bearer Cp01BwnXAIOLZXxn7yogjKqIZnZpQD

Method: POST

HTTP body

json

REQUIRED

Sample HTTP body
{
"first_name" : "John",
"last_name" : "Doe",
"display_name": "John Doe",
"user_name" : "JohnD",
"password" : "password",
"email" : "jdoe@opswat.com",
"security_question" : "FavoritePetName",
"security_answer" : "Bobby",
"role" : "user",
"expires" : "2019-07-15T04:14:50.0000000Z"
}

Descriptions of body:

first_name

User first name

REQUIRED

last_name

User last name

REQUIRED

user_name

User login/user name

REQUIRED

display_name

User display name

OPTIONAL

password

User password

REQUIRED.

email

User email address

OPTIONAL

security_question

User security question
for password recovery

OPTIONAL
Possible values:

  • CityNameWhereSpouseWasMet

  • FavoritePetName

  • OldestChildMiddleName

  • BestHighSchoolFriendName

  • OldestSiblingMiddleName

  • MotherMaidenName

  • CityNameOfFirstJob

  • SpouseMotherMaidenName

  • FavoriteTeacherName

  • FirstCarMakeAndModel

security_answer

User's answer to security question
for password recovery

OPTIONAL

role

User role

REQUIRED
Possible values:
User
Administrator
Supervisor
Guest

expires

Account expiry date

OPTIONAL (only if 'expires_after' is not specified). Specify a date+time (in UTC) when the account should expire. Cannot be combined with 'expires_after' property.
If this header is not specified the account will never expire.

expires_after

Account expiry time span

OPTIONAL (only if 'expires' is not specified) . Specify in DD:HH:MM:SS. Cannot be combined with 'expires' property.
If this header is not specified the account will never expire.

The value ranges are the following:
- Days, ranging from 0 to 10675199;
- Hours, ranging from 0 to 23;
- Minutes, ranging from 0 to 59;
- Optional seconds, ranging from 0 to 59.

Boundaries:
Maximum expiry date is: 9999/12/31 23:59:59:59. You cannot specify a time span that will exceed this date.

Request Code

200

OK

successful request

300

Ambiguous

Invalid user type.

400

Bad Request

Invalid HTTP request

401

Unauthorized

Invalid/expired token (API key).

403

Forbidden

Authentication token is incorrect

409

Conflict

Email address already exists.

500

Internal Server Error

Server is temporarily unavailable

Response

Example of a successful request:

{
"created": "2018-01-08T13:50:09.0000000Z",
"display_name": null,
"email": "jdoe@opswat.com",
"expires": "2019-07-15T04:14:50.0000000Z",
"first_name": "John",
"groups": null,
"last_name": "Doe",
"owner": null,
"role": "User",
"status": "Enabled",
"user_id": 2,
"user_name": "JohnD"
}

Descriptions of response:

created

User's creation date

display_name

User's display name

expires

User's expiration date

first_name

User's first name

groups

Represents the groups where the user is included

last_name

User's last name

owner

Represents the guest user's owner.

Value is null if user has other role than guest.

role

User's role. Possible values:

User
Administrator
Supervisor
Guest

status

User's availability status. Possible values:

Disabled
Enabled
Suspended
Unlicensed

user_id

Unique user ID

user_name

The username user to log in.