JSON API » people » people/create

Creates a new person.

Input parameters

Requires authentication and the administrator or wholesale role privileges.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
usernameStringUser name.Yes
emailStringEmail address(es).Yes
passwordStringPassword.Yes, unless copy_password is specified.
roleIntegerID of role.Yes
companyStringCompany name.NoEmpty string.
customerStringID of customer to create in.NoCustomer of authentication user.
copy_passwordIntegerID of another person in the same customer to copy the password from. 0 to use the password parameter instead.No0
countryStringTwo letter country code.NoCountry of customer.
date_formatStringDate format. "DD/MM/YYYY", "MM/DD/YYYY", or "YYYY-MM-DD".No"YYYY-MM-DD"
descriptionStringDescription.NoEmpty string.
extensionStringNumber for forward to in dial by name. Empty string for none.NoEmpty string.
faxStringFax number.NoEmpty string.
forenameStringFirst name.NoEmpty string.
languageStringLanguage code. Empty string for default.NoEmpty string.
mobileStringMobile (cellular) number.NoEmpty string.
public_keyStringGPG public key.NoEmpty string.
sourceStringSource IP address(es). Empty string for any.NoEmpty string.
surnameStringLast name.NoEmpty string.
telephoneStringTelephone number.NoEmpty string.
time_formatStringTime format. "12" or "24".No"24"
timezoneStringTime zone. Empty string for default.NoTime zone of customer.
titleStringTitle.NoEmpty string.
validationInteger1 to validate input then return, 0 for full action.No0

The email address is not required if the system is configured not to require it.

Responses

CodeDescription
200Success.
201Input passed validation. Only returned if validation=1.
400Invalid input parameters specified. Check the key and message fields for more details.
401The authentication details provided are invalid.
402Your role does not allow this.
403Your rate plan does not allow this.

Data returned

The ID of the created person.

Example: With required parameters

http://enswitch.example.com/api/json/people/create/?auth_username=user;auth_password=password;username=user@example.com;email=user@example.com;password=secret;role=1

{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":{ "id":123 } }

Change history

VersionChanges
3.13Function added.