API Create Account

Api Create Account

Put a new account on FunShine Online. The api token must be valid. The account code is required. An array of account attributes will be returned along with an error code and error message.

Put call format:
http://www.funshineonline.com/api/createAccount.php?api_token=:token&accountCode=:code&accountName=:name &address=:street,:city,:state,:zip&phone=:phone&firstName=:firstName&lastName=:lastName&email=:email
- api_token : required, 32 character token(a token will be assigned)
- accountCode : required, key value on non-FunShine Online system, e.g. TEST3
- accountName : optional, name associated with the account, e.g. ABC Daycare
- accountType : optional, type of account TRIAL/PAID, default=TRIAL
- address : optional, full address associated with the account, e.g. 123 Main Street,Columbus,OH,43222
- phone : optional, phone number associated with the account, e.g. (888) 123-1234
- firstName : optional, contact person associated with the account , e.g. Test
- lastName : optional, contact person associated with the account , e.g Admin
- email : optional, if included, a user Admin account will be created, e.g. testadmin@e18s.com
- password : optional, if included, will set the password on the new Admin account


Object:

Format json
{
    "account": [
        {
            "id": "973",
            "code": "TEST3",
            "name": "Test Account",
            "address": [
                {
                    "street":"123 Main Street",
                    "city":"Columbus",
                    "state":"OH",
                    "zip":"43222",
                }
            ],
            "phone":"(888) 123-1234",
           "contact":"Test Admin",
           "active":"Yes",
         }
    ]
   "user": [
       {
           "email" : "testadmin@e18s.com",
           "firstname" : "Test",
           "lastname" : "Admin",
           "role" : "Account Admin",
       }
   ]  
  "error_code": 0,
  "error_message": "Successful."
}
 
Example:
PHP:
$listurl = "http://www.funshineonline.com/api/createAccount.php?api_token=" . $token . "&accountCode=" . $accountCode . "&accountName=" . $accountName . "&address=" . $street . "," . $city . "," . $state . "," . $zip . "&phone=" . $phone . "&firstname=" . $firstName . "&lastname=" . $lastName . "&email=" . $email . "&password=" . $password;
$jsonData = file_get_contents($listurl);
$theData = json_decode($jsonData, true);
print_r($theData);

Back