API List Activities For

Api List Activities For

Get a list of all FunShine activities for one user, one date span. The api token must be valid. The user email must be active on FunShine. The date(s) must be valid. An array of activities will be returned along with a count of the number of activities and an error code and error message for each date in the date span. Each activity will have an ID, a title, a summary, a date, and a list of goal (indicator) IDs.

Get call format:
http://www.funshineonline.com/api/listActivitiesFor.php?api_token=:token&email=:email&date1=:yyyy-mm-dd&date2=:yyyy-mm-dd
- api_token : required, 32 character token (click here to see instructions on setting up a token)
- email : required, FunShine Online login ID (click here to see instructions to get a list of users and their email IDs)
- date1 : optional, format yyyy-mm-dd, default today indicates which date of the lesson plan to pull the activities or the start date of a date span
- date2 : optional, format yyyy-mm-dd, default date1 indicates the last date of a date span to pull the activities

Object:

Format json
{
    "count": "19",
    "activities": [
              {
                 "id": "23589",
                 "name": "Sleeping Game",
                 "summary": "A light switch is used as a signal in a simple game.",
                 "lesson_date": "2018-02-19",
                 "goals": "["0" : "809", "1" : "811", "2" : "871", "3" : "873"]",
             },
             {
                 "id": "23593",
                 "name": "Shadow Shapes 2018",
                 "summary": "Children explore the opposites of light and dark with shadows.",
                 "lesson_date": "2018-02-19",
                 "goals": "["0" : "709", "1" : "711", "2" : "713"]",
            },
          ],
     "error_code": "0",
     "error_message": "Successful"
}
 
Example:
PHP:
$listurl = "http://www.funshineonline.com/api/listActivitiesFor.php?api_token=" . $token . "&email=" . $email . "&date1=" . $date1 . "&date2=" . $date2;
$jsonData = file_get_contents($listurl);
$theData = json_decode($jsonData, true);
print_r($theData);

Back