# API - Add Account (JSON)

Overview

Enables an account to be created from remote website or application. Please read the information below carefully.

JSON Wrapper Structure

Your json wrapper structure should look like the following:
{
"api" : "YOUR KEY",
"op" : "account",
"accounts" : { account data as shown below }
}
Op type is "account" and must NOT be changed. API key must be same as key in settings.

Account Data

Multiple accounts are possible with each transmission. All accounts are a part of the "account" object. Structure as follows for single account:
"account" : {
"name" : "Name or alias",
"email" : "Email address",
"password" : "Password in raw format",
"timezone" : "Supported timezone",
"ip" : "IP address",
"language" : "Supported language",
"notes" : "Optional notes"
}
Multiple entries are specified using the [] operator within the same "account" object. Example:
"account" : [{
"name" : "Name or alias",
"email" : "Email address",
"password" : "Password in raw format",
"timezone" : "Supported timezone",
"ip" : "IP address",
"language" : "Supported language",
"notes" : "Optional notes"
},{
"name" : "Name or alias",
"email" : "Email address",
"password" : "Password in raw format",
"timezone" : "Supported timezone",
"ip" : "IP address",
"language" : "Supported language",
"notes" : "Optional notes"
}]
Name/Email - Required. Email must be unique and valid.
Password - Must be in raw format. It will be encoded by the system. Leave blank to auto generate a password.
Timezone - Must be valid timezone as set in the "control/timezones.php" file. Example: US/Pacific
IP - Leave blank if not known. Will be updated on first login.
Language - Must be supported language (english, german etc). If not, will revert to default language.
Notes - Optional backend notes

JSON Response

On successful transmission a json response is returned:
{
"status" : "OK",
"accountID" : "Database ID of account created. For additional custom ops if required. If multiple, array of ID values."
"message" : ""
}
If an error occurs, the following is returned:
{
"status" : "ERROR",
"message" : "Reason for error.."
}
Your own application should deal with the response accordingly.

Example File

Click here to view an example json file.

Return to API Overview