$ch = curl_init(); $headers = array( 'Content-Type: application/json', 'Access-Control-Allow-Origin: *', ); $data = array( 'username' => $config->smsemail, 'lmstoken' => $config->smstoken, 'subDomain' => $config->smssubdomain ); $data = json_encode($data); $curl_url = 'https://api.rto.net.au/api/Login'; curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_URL, $curl_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); $response = json_decode(curl_exec($ch)); if (curl_getinfo($ch,CURLINFO_HTTP_CODE)==200) { return $response->token; } |
$ch = curl_init(); $headers = [ 'Accept: application/json', 'Content-Type: application/json', 'Access-Control-Allow-Origin: *', 'Authorization: Bearer ' . $token, ]; $data = [ 'studentName' => $student->firstname, 'studentSurname' => $student->lastname, 'studentEmail' => $student->email, ]; $curl_url = 'https://api.rto.net.au/api/Student'; curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_URL, $curl_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); $response = json_decode(curl_exec($ch)); if ($response->success) { return $response->newId; } |
$ch = curl_init(); $headers = [ 'Accept: application/json', 'Content-Type: application/json', 'Access-Control-Allow-Origin: *', 'Authorization: Bearer ' . $token, ]; $data = [ 'studentID' => $smsProfile->contactid, 'studentName' => $student->_instance->firstname, 'studentSurname' => $student->_instance->lastname, 'studentEmail' => $student->_instance->email, 'studentUniqueStudentIdentifier' => $smsProfile->usi, 'studentMobileNumber' => $smsProfile->mobile_number, 'studentDOB' => date('d-m-Y', $smsProfile->date_of_birth), 'studentGender' => $smsProfile->gender, 'studentPostalPropertyName' => $smsProfile->postal_apartment, 'studentPostalStreetNumber' => $smsProfile->postal_house_number, 'studentPostalStreetName' => $smsProfile->postal_street, 'studentPostalBox' => $smsProfile->post_office_box, 'studentPostalSuburb' => $smsProfile->postal_suburb, 'studentPostalPostcode' => $smsProfile->postal_post_code, 'studentPostalState' => $this->normalizeTerritory($smsProfile- >postal_state), 'studentPropertyName' => $smsProfile->residental_apartment, 'studentStreetNumber' => $smsProfile->residental_house_number, 'studentStreetName' => $smsProfile->residental_street, 'studentSuburb' => $smsProfile->residental_suburb, 'studentPostcode' => $smsProfile->residental_post_code, 'studentCountryOfResidence' => $smsProfile->residental_country, 'studentState' => $this->normalizeTerritory($smsProfile->residental_state), 'studenDisabilityFlag' => $disabilityFlag, 'studentIndividualHearing' => $hearing, 'studentIndividualPhysical'=> $physical, 'studentIndividualIntellectual'=> $intellectual, 'studentIndividualLearning'=> $learning, 'studentIndividualMentalIllness'=> $mental, 'studentIndividualAcquiredBrainImpairment'=> $brain, 'studentIndividualVision'=> $vision, 'studentIndividualMedicalCondition'=> $condition, 'studentIndividualOther'=> $other ]; $curl_url = 'https://api.rto.net.au/api/Student'; curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_URL, $curl_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); $response = json_decode(curl_exec($ch)); if ($response->success) { // insert additional code for successful update here } |
$ch = curl_init(); $headers = [ 'Accept: application/json', 'Content-Type: application/json', 'Access-Control-Allow-Origin: *', 'Authorization: Bearer ' . $token, ]; $data = array(); $curl_url = 'https://api.rto.net.au/api/Enrolment?StudentNumber=' . $studentnumber . '&GroupID=' . $groupid; curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_URL, $curl_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); $response = json_decode(curl_exec($ch)); if ($response->success) { return $response->newId; } |
$ch = curl_init(); $headers = [ 'Accept: application/json', 'Content-Type: application/json', 'Access-Control-Allow-Origin: *', 'Authorization: Bearer ' . $token, ]; $curl_url = 01&EndDate=2022-03-05'; curl_setopt($ch, CURLOPT_URL, $curl_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); $response = json_decode(curl_exec($ch)); if ($response->success) { return $response->unitLst; } |
$ch = curl_init(); $headers = [ 'Accept: application/json', 'Content-Type: application/json', 'Access-Control-Allow-Origin: *', 'Authorization: Bearer ' . $token, ]; 01&EndDate=2022-03-05'; curl_setopt($ch, CURLOPT_URL, $curl_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); $response = json_decode(curl_exec($ch)); if ($response->success) { return $response->llnLst; } |
| Property | Description |
URL | |
Methods supported | POST, PUT |
NOTE: Client where the group will be added depends on the username and subdomain used to get the token.| Field | Description | Required | Rules |
GroupName | The name assigned to the student group | Yes | If group name is more than 45 characters, group will not be created and API will respond with error “Group name is too long. Please use 45 characters or less” |
ProgramInstanceId | Refers to the specific instance of the program/course the group is linked to | Yes | If Program Instance ID passed in API request is not a program instance of the client, group will not be created and API will respond with error “Program Instance Id Invalid” |
Active | Indicates whether the group is currently active and available for use or enrolments | No | Set to false/0 if not passed in API request |
StartDate | The date on which the group officially commences training or classes | Only if Program Instance’s type is Intake | |
EndDate | The date on which the group completes its training or classes | Only if Program Instance’s type is Intake | |
AutoRemove | Automatically removes students from the group under certain conditions (Never, Date only, Max students only, Max students or date) | No | Set to ‘Never’ if not passed in API request, and will ignore passed values of Max Students and Prior Hours (if there’s any) |
MaxStudents | Defines the maximum number of students that can be enrolled in the group | Only if Auto Remove is ‘Max Students‘ or ‘Max Students or Date’ | |
PriorHours | Sets a threshold of hours before the group start time during which students can no longer enrol via the enrolment form | Only if Auto Remove is ‘Date Only ‘or ‘Max Students or Date’ | |
Location | The physical location or campus where the training will be delivered | Yes | If Location passed in API request is not a location of the client, group will not be created and API will respond with error “Location is Invalid” Accepts Location ID (NOT the actual id from database table) |
Trainers | List of email addresses of trainers assigned to deliver the training for the group | No | If Trainer passed in API request is not a trainer of the client or is a trainer of the client but not active, group will not be created and API will respond with error “Trainer not Valid” Can also accept email addresses of users with no trainer access but also provides training |
{ "GroupName": "Group 1", "ProgramInstanceId": "675", "Active": true, "StartDate": "04/11/2025", "EndDate": "29/11/2025", "AutoRemove": "Max Students or Date", "MaxStudents": 10, "PriorHours": 2, "Location": "001", "Trainers": ["trainer@email.com", “trainer2@email.com”] } |
{ “success”: true, “msg”: “Group Successfully Added”, “groupId:”: 743 } |
| Field | Description | Required | Rules |
| GroupId | The ID of the group to be updated | Yes | If Group ID passed in API request is not a group of the client, group will not be updated and API will respond with error “Invalid Group Id” |
| GroupName | The name assigned to the student group | Yes | If group name is more than 45 characters, group will not be updated and API will respond with error “Group name is too long. Please use 45 characters or less” |
| ProgramInstanceId | Refers to the specific instance of the program/course the group is linked to | Yes | If Program Instance ID passed in API request is not a program instance of the client, group will not be updated and API will respond with error “Program Instance Id Invalid” If Program Instance ID passed in API request is a program instance of the client but already has students enrolled, group will not be updated and API will respond with error “Program Instance cannot be changed for the Group” |
| Active | Indicates whether the group is currently active and available for use or enrolments | No | |
| StartDate | The date on which the group officially commences training or classes | Only if Program Instance’s type is Intake | |
| EndDate | The date on which the group completes its training or classes | Only if Program Instance’s type is Intake | |
| AutoRemove | Automatically removes students from the group under certain conditions (Never, Date only, Max students only, Max students or date) | No | |
| MaxStudents | Defines the maximum number of students that can be enrolled in the group | Only if Auto Remove is ‘Max Students‘ or ‘Max Students or Date’ | |
| PriorHours | Sets a threshold of hours before the group start time during which students can no longer enrol via the enrolment form | Only if Auto Remove is ‘Date Only ‘or ‘Max Students or Date’ | |
| Location | The physical location or campus where the training will be delivered | Yes | If Location passed in API request is not a location of the client, group will not be updated and API will respond with error “Location is Invalid” Accepts Location ID (NOT the actual id from database table) |
AddTrainers | List of email addresses of trainers to be added in the group | No | If Trainer passed in API request is not a trainer of the client or is a trainer of the client but not active, group will not be updated and API will respond with error “Trainer not Valid” Can also accept email addresses of users with no trainer access but also provides training |
RemoveTrainers | List of email addresses of trainers to be removed in the group | No |
{ "GroupId": "743", "GroupName": "Group 2", "ProgramInstanceId": "675", "StartDate": "01/01/2025", "EndDate": "01/01/2026", "AutoRemove": "Max Students or Date", "MaxStudents": 2, "PriorHours": 2, "Location": "testcampus", "AddTrainers":["trainer3@email.com"], "RemoveTrainers":["trainer@email.com"] } |
NOTE: Unchanged fields can be excluded from the API PUT request. Current values of the fields not passed in the request will be retained.{ “success”: true, “msg”: “Group Successfully Updated”, “groupId:”: 743 } |
| Property | Description |
| URL | https://api.rto.net.au/api/Event/schedule |
| Methods supported | POST, PUT |

| Field | Description | Required | Rules |
| ScheduleGroupUnits | List of groups who will be attending the event and the related unit(s) | Yes | If Group passed in API request is not a group of the client, event will not be created and API will respond with error “Group is invalid” If Unit passed in API request is not related to the group, event will not be created and API will respond with error “Unit is not related to the group” Note: It is not required to pass units, it may be the group only. |
| Title | A descriptive title or schedule name to the calendar entry | Yes | If Title is more than 255 characters, event will not be created and API will respond with error “Title is too long. Please use 255 characters or less.” |
| Location | The location for the event | No | If Location is not passed in API request, location of the first group in the event will be set to the event If Location passed in API request is not a location of the client, event will not be created and API will respond with error “Location is invalid” Accepts Location ID (NOT the actual id from database table |
| Room | If location has rooms available, a room can also be set for the event | No | If Room passed in API request is not related to the location, event will not be created and API will respond with error “Room is invalid” |
| TrainerEmails | List of assigned trainers for the event | Yes | If Trainer passed in API request is not related to the group, event will not be created and API will respond with error “Trainer is invalid” |
| Color | The colour of the calendar entry for quick categorisation and visualisation | No | Only accepts certain colours; if Colour passed is not included in the valid colour list, event will not be created and API will respond with error “Color is invalid. Accepted color names: black, blue, cool gray, cyan, dandelion, green, indigo, magenta, mauve, melrose, mercury, navy blue, lime, orange, pink, purple, red, teal, turquoise, yellow” If Colour is not passed in API request, colour from the Program Instance of the first group in the event will be set to the event; and if there is no colour in the Program Instance, the first colour in the valid colour list will be set to the event |
| StartDateTime | The date and time event starts | Only if CustomRecurrence is ‘None’ | |
| EndDateTime | The date and time event starts | Only if CustomRecurrence is ‘None’ | If EndDateTime is set as before the StartDateTime, event will not be created and API will respond with error “End Date Time is invalid, End Date Time cannot be before the Start Date Time” |
| ScheduleHours | The number of actual event hours | Only if CustomRecurrence is ‘None’ | If ScheduleHours is set as 00:00 or longer than the duration of the event (from StartDateTime to EndDateTime), event will not be created and API will respond with error “Scheduled hours must be greater than 00:00 and cannot be longer than the duration of event” |
CustomRecurrence | Determines if event to be created is a recurring event or not | No | Only accepts: None, Weekly, Monthly, and MonthlyDay If CustomRecurrence is not passed in API request, CustomRecurrence will be set to None by default |
Days | For CustomRecurrence = Weekly List of specific Days the event will occur, as well as the Start Time, End Time, and Scheduled Hours for each Day | Only if CustomRecurrence is Weekly | Day only accepts: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, and Sunday If Day passed in API request is not included in valid day list, event will not be created and API will respond with error “Invalid Day ‘<Day>’” If EndTime is set as before the StartTime, event will not be created and API will respond with error “Invalid time range for <Day>” If ScheduledHours is set as 00:00 or longer than the duration of the event for a day (from StartTime to EndTime), event will not be created and API will respond with error “Scheduled hours must be greater than 00:00 and cannot be longer than the duration of event” |
NumberOfWeeksRecurring | For CustomRecurrence = Weekly The number of weeks when each event will recur for the specified days of the week. e.g. If recur every 1 week is set, the schedule will be plotted every week during the specified days | Only if CustomRecurrence is Weekly | |
RecurrenceStartDate | For CustomRecurrence = Weekly/Montly/MonthlyDay The date when recurrence starts | Only if CustomRecurrence is Weekly, Monthly, or MonthlyDay | |
RecurrenceStopRepeatOnSpecificDate | For CustomRecurrence = Weekly/Montly/MonthlyDay The date until when the last recurrence will be created in the calendar | Only if CustomRecurrence is Weekly, Monthly, or MonthlyDay | If RecurrenceStopRepeatOnSpecificDate is set as before the RecurrenceStartDate , event will not be created and API will respond with error “Invalid End Date” |
RecurrenceStartTime | For CustomRecurrence = Montly/MonthlyDay The time when event starts for each of the day of the selected schedule | Only if CustomRecurrence is Monthly or MonthlyDay | |
RecurrenceEndTime | For CustomRecurrence = Montly/MonthlyDay The time when event ends for each of the day of the selected schedule | Only if CustomRecurrence is Monthly or MonthlyDay | If RecurrenceEndTime is set as before the RecurrenceStartTime, event will not be created and API will respond with error “RecurrenceStartTime must be earlier than RecurrenceEndTime” |
RecurrenceScheduleHours | For CustomRecurrence = Montly/MonthlyDay The number of actual event hours | Only if CustomRecurrence is Monthly or MonthlyDay | If RecurrenceScheduleHours is set as 00:00 or longer than the duration of the event for a day (from RecurrenceStartTime to RecurrenceEndTime), event will not be created and API will respond with error "RecurrenceScheduleHours must be greater than 00:00 and cannot exceed the duration" |
ScheduleDateRecurEvery | For CustomRecurrence = MonthlyDay The number of interval for the monthly recurrence e.g. If recur every 1 month is set, the schedule will be plotted every month specified day | Only if CustomRecurrence is MonthlyDay | |
MonthlyDayWeek | For CustomRecurrence = MonthlyDay The ordinal week of the month e.g. If recur every first week, the schedule will be plotted every first week of the month on the specified day | Only if CustomRecurrence is MonthlyDay | MonthlyDayWeek only accepts: First, Second, Third, Fourth, and Last |
MonthlyDayDay | For CustomRecurrence = MonthlyDay The day of the month the event will repeat e.g. If recur every Monday, the schedule will be plotted every Monday of the month on the specified ordinal week | Only if CustomRecurrence is MonthlyDay | MonthlyDay only accepts: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, and Sunday |
{ "scheduleGroupUnits": [ { "groupId": 804, "unitCodes": ["ABCD0001", "ABCDEF100s"] }, { "groupId": 805, "unitCodes": ["ABCD0001", "ABCD0003"] } ], "title": "Event With Weekly Recur", "location": "testcampus", "room": "test room", "trainerEmails": ["trainer@email.com"], "color": "blue", "CustomRecurrence": "weekly", "days": [ { "day": "Wednesday", "startTime": "08:00", "endTime": "09:00", "scheduledHours": "01:00" }, { "day": "Thursday", "startTime": "08:00", "endTime": "09:00", "scheduledHours": "01:00" } ], "numberOfWeeksRecurring": 1, "recurrenceStartDate": "01-12-2025", "recurrenceStopRepeatOnSpecificDate": "31-12-2025" } |
{ "success": true, "msg": "Added New Schedule 9259", "scheduleId": 9259 } |
| Field | Description | Required | Rules |
| EventId | The ID of the event to be updated | Yes | If event ID passed in API request is not an event of the client, group will not be updated and API will respond with error “Schedule is invalid” |
| ScheduleGroupUnits | List of groups who will be attending the event and the related unit(s) | Yes | If Group passed in API request is not a group of the client, event will not be updated and API will respond with error “Group is invalid” If Unit passed in API request is not related to the group, event will not be updated and API will respond with error “Unit is not related to the group” |
| Title | A descriptive title or schedule name to the calendar entry | Yes | If Title is more than 255 characters, event will not be updated and API will respond with error “Title is too long. Please use 255 characters or less.” |
| Location | The location for the event | No | If Location passed in API request is not a location of the client, event will not be updated and API will respond with error “Location is invalid” Accepts Location ID (NOT the actual id from database table) |
| Room | If location has rooms available, a room can also be set for the event | No | If Room passed in API request is not related to the location, event will not be updated and API will respond with error “Room is invalid” |
| TrainerEmails | List of assigned trainers for the event | Yes | If Trainer passed in API request is not related to the group, event will not be updated and API will respond with error “Trainer is invalid” |
| Color | The colour of the calendar entry for quick categorisation and visualisation | No | Only accepts certain colours; if Colour passed is not included in the valid colour list, event will not be updated and API will respond with error “Color is invalid. Accepted color names: black, blue, cool gray, cyan, dandelion, green, indigo, magenta, mauve, melrose, mercury, navy blue, lime, orange, pink, purple, red, teal, turquoise, yellow” If Colour is passed but an empty string (e.g. “Color”: “”) in API request, colour from the Program Instance of the first group in the event will be set to the event; and if there is no colour in the Program Instance, the first colour in the valid colour list will be set to the event |
StartDateTime | The date and time event starts | Only if CustomRecurrence is ‘None’ | |
EndDateTime | The date and time event starts | Only if CustomRecurrence is ‘None’ | If EndDateTime is set as before the StartDateTime, event will not be updated and API will respond with error “End Date Time is invalid, End Date Time cannot be before the Start Date Time” |
ScheduleHours | The number of actual event hours | Only if CustomRecurrence is ‘None’ | If ScheduleHours is set as 00:00 or longer than the duration of the event (from StartDateTime to EndDateTime), event will not be updated and API will respond with error “Scheduled hours must be greater than 00:00 and cannot be longer than the duration of event” |
UpdateOtherEvents | Determines if other related events will be updated as well or not, for events created with CustomRecurrence | No | Only accepts: 1, 2, or 3 1 = will update only the specified event ID in API request 2 = will update the event ID set in API request and the succeeding related events 3 = will update all the related events (including the preceding and succeeding events) If UpdateOtherEvents is not passed in API request, only the specified event ID will be updated |
{ "eventId": 9259, "scheduleGroupUnits": [ { "groupId": 804, "unitCodes": ["ABCD0001", "ABCDEF100s"] }, { "groupId": 805, "unitCodes": ["ABCD0001", "ABCD0003"] } ], "title": "Updated Event", "location": "001", "room": "Room test", "trainerEmails": ["trainer2@email.com"], "color": "cyan", "startDateTime": "01-01-2026 07:00", "endDateTime": "31-01-2026 08:00", "scheduleHours": "01:00", "updateOtherEvents": 3 } |

{ "success": true, "msg": "Updated Schedule 9259", "scheduleId": 9259 } |