1. Go to this page and download the library: Download wondeltd/php-client library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
wondeltd / php-client example snippets
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$client = new \Wonde\Client('TOKEN_GOES_HERE');
// Loop through the schools your account has access to
foreach ($client->schools->all() as $school) {
// Display school name
echo $school->name . PHP_EOL;
}
$client = new \Wonde\Client('TOKEN_GOES_HERE');
// Get single school
$school = $client->schools->get('SCHOOL_ID_GOES_HERE');
$client = new \Wonde\Client('TOKEN_GOES_HERE');
foreach ($client->schools->pending() as $school) {
// Display school name
echo $school->name . PHP_EOL;
}
$client = new \Wonde\Client('TOKEN_GOES_HERE');
// Search for schools with a postcode starting CB21
foreach ($client->schools->search([], ['postcode' => 'CB21']) as $school) {
// Display school name
echo $school->name . PHP_EOL;
}
// Search for schools with the establishment number = 6006
foreach ($client->schools->search([], ['establishment_number' => '6006']) as $school) {
// Display school name
echo $school->name . PHP_EOL;
}
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$client->requestAccess('A0000000000');
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$client->revokeAccess('A0000000000');
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$school = $client->school('SCHOOL_ID_GOES_HERE');
// Get students
foreach ($school->students->all() as $student) {
echo $student->forename . ' ' . $student->surname . PHP_EOL;
}
// Get single student
$student = $school->students->get('STUDENT_ID_GOES_HERE');
// Get students and ontact_details object,
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$school = $client->school('SCHOOL_ID_GOES_HERE');
// Get students
foreach ($school->studentsPreAdmission->all() as $studentPreAdmission) {
echo $studentPreAdmission->forename . ' ' . $studentPreAdmission->surname . PHP_EOL;
}
// Get single student
$student = $school->studentsPreAdmission->get('STUDENT_ID_GOES_HERE');
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$school = $client->school('SCHOOL_ID_GOES_HERE');
// Get achievements
foreach ($school->achievements->all() as $achievement) {
echo $achievement->comment . PHP_EOL;
}
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$school = $client->school('SCHOOL_ID_GOES_HERE');
$school->achievements->delete('WONDE_ACHIEVEMENTS_ID_HERE');
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$school = $client->school('SCHOOL_ID_GOES_HERE');
// Get achievement attributes
foreach ($school->achievementsAttributes->all() as $achievement) {
echo $achievement->id . PHP_EOL;
}
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$school = $client->school('SCHOOL_ID_GOES_HERE');
// Get aspects
foreach ($school->assessment->aspects->all() as $aspect) {
echo $aspect->id . PHP_EOL;
}
// Get templates
foreach ($school->assessment->templates->all() as $templates) {
echo $templates->id . PHP_EOL;
}
// Get result sets
foreach ($school->assessment->templates->all() as $resultsets) {
echo $resultsets->id . PHP_EOL;
}
// Get results
foreach ($school->assessment->results->all() as $results) {
echo $results->id . PHP_EOL;
}
// Get marksheets
foreach ($school->assessment->marksheets->all() as $marksheets) {
echo $marksheets->id . PHP_EOL;
}
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$school = $client->school('SCHOOL_ID_GOES_HERE');
// Get attendance
foreach ($school->attendance->all() as $attendance) {
echo $attendance->comment . PHP_EOL;
}
$client = new \Wonde\Client('TOKEN_GOES_HERE');
// Initiate a new register
$register = new \Wonde\Writeback\SessionRegister();
// Initiate a new attendance record
$attendance = new \Wonde\Writeback\SessionAttendanceRecord();
// Set fields
$attendance->setStudentId('STUDENT_ID_GOES_HERE');
$attendance->setDate('2017-01-01');
$attendance->setSession('AM'); // AM or PM
$attendance->setAttendanceCodeId('ATTENDANCE_CODE_ID_GOES_HERE');
$attendance->setComment('Comment here.');
$attendance->setMinutesLate(10);
// Add attendance mark to register
$register->add($attendance);
// Save the session register
$result = $school->attendance()->sessionRegister($register);
// Writeback id is part of the response
echo $result->writeback_id;
$client = new \Wonde\Client('TOKEN_GOES_HERE');
// Get attendance codes
foreach ($client->attendanceCodes->all() as $attendanceCode) {
echo $attendanceCode->code . PHP_EOL;
}
// Get school attendance codes
$school = $client->school('SCHOOL_ID_GOES_HERE');
foreach ($school->attendanceCodes->all() as $attendanceCode) {
echo $attendanceCode->code . PHP_EOL;
}
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$school = $client->school('SCHOOL_ID_GOES_HERE');
// Get attendance summaries
foreach ($school->attendanceSummaries->all() as $attendanceSummary) {
echo $attendance->possible_marks . PHP_EOL;
}
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$school = $client->school('SCHOOL_ID_GOES_HERE');
// Get behaviours
foreach ($school->behaviours->all() as $behaviour) {
echo $behaviour->incident . PHP_EOL;
}
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$school = $client->school('SCHOOL_ID_GOES_HERE');
// Get deletions
foreach ($school->deletions->all() as $deletions) {
echo $deletions->id;
}
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$school = $client->school('SCHOOL_ID_GOES_HERE');
// Get employees
foreach ($school->employees->all() as $employee) {
echo $employee->forename . ' ' . $employee->surname . PHP_EOL;
}
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$school = $client->school('SCHOOL_ID_GOES_HERE');
// Get employee absences
foreach ($school->employeeAbsences->all() as $employeeAbsence) {
echo $employeeAbsence->employee . ' ' . $employeeAbsence->absence_type . PHP_EOL;
}
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$school = $client->school('SCHOOL_ID_GOES_HERE');
// Get events
foreach ($school->events->all() as $event) {
echo $event->id . PHP_EOL;
}
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$school = $client->school('SCHOOL_ID_GOES_HERE');
// Get groups
foreach ($school->groups->all() as $group) {
echo $group->name . PHP_EOL;
}
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$school = $client->school('SCHOOL_ID_GOES_HERE');
// Get lessons
foreach ($school->lessons->all() as $lesson) {
echo $lesson->period_id . '-' . $lesson->class_id . PHP_EOL;
}
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$school = $client->school('SCHOOL_ID_GOES_HERE');
// Get lesson attendance
foreach ($school->lessonAttendance->all() as $lessonAttendance) {
echo $lessonAttendance->comment . PHP_EOL;
}
$client = new \Wonde\Client('TOKEN_GOES_HERE');
// Initiate a new register
$register = new \Wonde\Writeback\LessonRegister();
// Initiate a new attendance record
$attendance = new \Wonde\Writeback\LessonAttendanceRecord();
// Set fields
$attendance->setStudentId('STUDENT_ID_GOES_HERE');
$attendance->setLessonId('LESSON_ID_GOES_HERE');
$attendance->setAttendanceCodeId('ATTENDANCE_CODE_ID_GOES_HERE');
// Add attendance mark to register
$register->add($attendance);
// Save the lesson register
$result = $school->lessonAttendance()->lessonRegister($register);
// Writeback id is part of the response
echo $result->writeback_id;
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$school = $client->school('SCHOOL_ID_GOES_HERE');
// Get medical conditions
foreach ($school->medicalConditions->all() as $medicalCondition) {
echo $medicalCondition->description . PHP_EOL;
}
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$school = $client->school('SCHOOL_ID_GOES_HERE');
// Get medical events
foreach ($school->medicalEvents->all() as $medicalEvent) {
echo $medicalEvent->description . PHP_EOL;
}
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$school = $client->school('SCHOOL_ID_GOES_HERE');
// Get doctors
foreach ($school->doctors->all() as $doctor) {
echo $doctor->surname . PHP_EOL;
echo $doctor->practice_name . PHP_EOL;
echo $doctor->telephone . PHP_EOL;
}
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$school = $client->school('SCHOOL_ID_GOES_HERE');
// Get periods
foreach ($school->periods->all() as $period) {
echo $period->name . PHP_EOL;
}
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$school = $client->school('SCHOOL_ID_GOES_HERE');
// Get photos
foreach ($school->photos->all() as $photo) {
echo $photo->hash . PHP_EOL;
}
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$school = $client->school('SCHOOL_ID_GOES_HERE');
// Get rooms
foreach ($school->rooms->all() as $room) {
echo $room->name . PHP_EOL;
}
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$school = $client->school('SCHOOL_ID_GOES_HERE');
// Get subjects
foreach ($school->subjects->all() as $subject) {
echo $subject->name . PHP_EOL;
}
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$metaObject = $client->meta->get('SCHOOL_ID_GOES_HERE');
json
{
"deltd/php-client": "3.*"
}
}
bash
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.