StaffAdd (
object Staff,
bool InviteUser,
bool WebhookEvaluate
)
Add a staff user.
Note: available since RPM23.
Request
Request Data:
- (bool) InviteUser (optional, default: false) – whether to send an email to the new user so they can finish setting up their account.
- (bool) WebhookEvaluate (optional, default: false) – whether RPM should issue webhook requests
- (object) Staff (required) – the data for the user
- (bool) Enabled (optional, default: false) – whether the user can login
- (int) RoleID (required) – identify the role to assign to the user
- (int) IsApiUser (optional, default: false) – whether to create a API staff user instead of a normal staff user (Since RPM25)
- (array) Groups (optional) – a list of staff groups following structure:
- (int) ID (optional) – the group ID.
- (object) Contact (required) – contact an user information:
- (string) Salutation (optional) – one of “Mr.”, “Ms.” or “Dr.”
- (string) FirstName (required) – the person’s name
- (string) LastName (required) – the person’s last name
- (string) Title (optional) – the person’s title
- (string) Email (required) – the person’s email
- (array) PhoneNumbers (optional) – a list of up to 4 phone numbers, each using the following structure:
- (string) Number (optional) – the phone number.
- (enum) Type (optional) – number indicating the type phone number it is: 1-Business, 2-Home, 3-Fax, 4-Other. There cannot be repeated types.
- (array) Fields (optional) – a list of basic fields to fill in, each using the following structure:
- (string) Field (optional) – the field name.
- (string) Value (optional) – the field value.
{
"InviteUser": <bool>,
"WebhookEvaluate": <bool>,
"Staff": {
"Enabled": <bool>,
"RoleID": <int>,
"IsApiUser": <bool>, // since RPM25
"Groups": [
{
"ID": <int>
}, // ... more groups
],
"Contact": {
"Salutation": <string>,
"FirstName": <string>,
"LastName": <string>,
"Title": <string>,
"Email": <string>,
"PhoneNumbers": [
{
"PhoneNumberID": <int>,
"Type": <enum 1=Business, 2=Home, 3=Fax, 6=Other>,
"Number": <string>
}, // ... 3 more (1 per Type)
]
},
"Fields": [
{
"Field": <string>,
"Value": <string>
},
// ... more fields
]
}
}
Response
{
"Result": {
"Username": <string>,
"UserID": <int>,
"Enabled": <bool>,
"StaffID": <int>,
"Name": <string>,
"RoleID": <int>,
"Role": <string>,
"Groups": [],
"Added": <string>,
"Contact": {
"ContactID": <int>,
"Salutation": <string>,
"FirstName": <string>,
"LastName": <string>,
"Title": <string>,
"Email": <string>,
"PhoneNumbers": [
{
"PhoneNumberID": <int>,
"Type": <int>,
"Number": <string>
}
]
},
"Fields": []
}
}
Notes
- Enabling users will affect costs starting in the current billing cycle.
Errors
- “RoleID is required”
- “Contact.FirstName is required”
- “Contact.LastName is required”
- “Invite requires an email address”