Adding users in JSON-RPC API
To add users, use the AddUser
method. Users are added one at a time.
Required parameters
Parameter | Description | Supported values |
---|---|---|
userInfo
|
A group of parameters related to the user | UserInfo (has child parameters of its own see the UserInfo child parameters table below) |
Parameter | Description | Supported values |
---|---|---|
ID
|
The ID number of the user | <int> Integer |
PartnerId |
The ID of the customer the user is created for (retrieved through the |
<int> Integer |
Name (required) |
A login name for the user (must be the same as the EmailAddress ) |
OptionalNonEmptyString
|
Password
|
Set a password for the new user | OptionalNonEmptyString
|
RoleId
|
The ID of the role the user will be given (retrieved through the enumerateUserRoles method) |
Choose Int that correlates to the role below:
|
ContactPersonId
|
The ID of the contact person that this new user will be associated with | <int> Integer |
TwoFactorAuthenticationStatus
|
An array of 2FA state's to give to the new user |
|
EmailAddress
|
The email address of the user (must be the same as the Name given) |
<std::String>
|
Flags
|
Flag the user with certain feature access | UserFlag::FlagsType
|
FirstLoginTime
|
The time-stamp of the first time the user has logged in successfully | <std::time_t> Integer in Unix format. For example, 1535673599 stands for August 30, 2018 |
LastLoginTime
|
The time-stamp of the last time the user has logged in successfully |
<std::time_t> Integer in Unix format. For example, 1535673599 stands for August 30, 2018 |
FirstName
|
The first name of the user |
<std::String>
|
FullName
|
The surname of the user | <std::String>
|
Title
|
A title given to the user of the user | <std::String>
|
PhoneNumber
|
The phone number of the user | <std::String>
|
Sample request
{ "id": "jsonrpc", "jsonrpc": "2.0", "visa": "{{visa}}", "method": "AddUser", "params": { "userInfo": { "Name" : "backup.test@mail.com", "PartnerId" : 123456, "Password" : "AbC123DeF!", "RoleId" : 1, "EmailAddress" : "backup.test@mail.com", "FirstName" : "Backup", "FullName" : "Test", "Title": "Manager" } } }
Sample response
{ "id": "jsonrpc", "jsonrpc": "2.0", "result": { "result": 876543 }, "visa": "{{visa}}" }