API Account User

Api Account User

Add, update or remove a user on FunShine Online. The api token must be valid. The account code is required. An array of user attributes will be returned along with an error code and error message.

Put call format:
http://www.funshineonline.com/api/accountUser.php?api_token=:token&accountCode=:code&email=:email&password=:password&firstName=:firstName&lastName=:lastName&action=:action&role=:role
- api_token : required, 32 character token(a token will be assigned)
- accountCode : required, key value on non-FunShine Online system, e.g. TEST3
- email : required, the user account to be acted upon, e.g. testadmin@e18s.com
- password : optional, set or reset the user account password,
- firstName : optional, the user's first name , e.g. John
- lastName : optional, the user's last name , e.g Doe
- action : optional, type of action to take on the user , ADD/CHANGE/REMOVE, defaults to ADD
- role: optional, role type the user will have on the account , ADMIN/TEACHER, defaults to TEACHER
- autoload: optional, indicates if lesson plans will be autoloaded for the user , TRUE/FALSE, defaults to FALSE
- autoloadAge: optional, age group to autoload lesson plans if the prior setting is TRUE , TODDLER/PRESCHOOL, defaults to TODDLER


Object:

Format json
{
   "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/accountUser.php?api_token=" . $token . "&accountCode=" . $accountCode . "&email=" . $email . "&firstname=" . $firstName . "&lastname=" . $lastName . "&action=" . $action . "&role=" . $role;
$jsonData = file_get_contents($listurl);
$theData = json_decode($jsonData, true);
print_r($theData);

Back