Using The SMS API

Using The SMS API

I. Login

A. Description 
This API function is used to authenticate the user with SMS. If successful, it returns a token that can be used to authorize calls to the other functions of SMS API. 

B. Information 

Method: POST 
Request Header:  
      Content-Type: application/json 
Request Body: 
“username”: “string” 
“password”: “string” 


C. Sample Usage in PHP  

$ch = curl_init(); 

 

$headers = array( 
    'Content-Type: application/json', 
    'Access-Control-Allow-Origin: *', 
); 

 

$data = array( 
    'username' => $config->smsemail, 
    'password' => $config->smspasswd 
); 
$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; 
} 


D. Successful 
If the username and password is verified against the SMS database, the HTTP Code should return 200, and JSON response body should contain an element named “token”. The value for this item must be saved to allow the use of the other functions in the API. 

E. Error 
If the user does not exist or the password is incorrect, HTTP Code should be 401 for Unauthorized. 


II. Add Students Details 

A. Description 
This API function is used to add a student record to SMS. This needs a valid token added to the HTTP header for authorization. The RTO where the student is added depends on the email address and password used to get the token.  

B. Information 
Method: POST 
Request Header:  
      Content-Type: application/json 
      Authorization: Bearer <token from login> 
Request Body: Refer to schema/model Student 
Response Body: Refer to schema/model APIResponse 

C. Sample Usage in PHP 

$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; 
} 



D. Successful 
If user was successfully added, the API will respond with JSON string containing element success set to true, and element newId set to an integer value representing the student number of the added record in SMS. 
 
E. Error 
If login token was not authenticated, the HTTP Code will be returned as 401 for Unauthorized. If authenticated, the API will respond with JSON string containing element success set to false, and element msg containing additional information on the error. 


III. Update Students Details 

A. Description 
This function is used to update an existing student record in SMS. Needs a valid token added to the HTTP header for authorization. RTO depends on the email address and password used to get the token. 

B. Information 
Method: PUT 
Request Header:  
      Content-Type: application/json 
      Authorization: Bearer <token from login> 
Request Body: Refer to schema/model Student 
Response Body: Refer to schema/model APIResponse 

C. Sample Usage in PHP 
 

$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 

​}

D. Successful
If user was successfully added, the API will respond with JSON string containing element success set to true.
E. Error
If login token was not authenticated, the HTTP Code will be returned as 401 for Unauthorized. If authenticated, the API will respond with JSON string containing element success set to false, and element msg containing additional information on the error.

IV. Enrol Student 

A. Description 
This function is used to enrol a student in a program instance in SMS via the group ID. This needs a valid token added to the HTTP header for authorization. The RTO depends on the email address and password used to get the token. 

B. Information 
Method: POST 
Request Header:  
      Content-Type: application/json 
      Authorization: Bearer <token from login> 
Parameters: 
StudentNumber: integer 
GroupID: integer 
Request Body: N/A 
Response Body: Refer to schema/model APIResponse 

C. Sample Usage in PHP 

$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; 
} 


D. Successful 
If enrolment was successful, the API will respond with JSON string containing element success set to true, and element newId set to an integer value representing the enrolment ID of the added record in SMS. 

E. Error 
If login token was not authenticated, the HTTP Code will be returned as 401 for Unauthorized. If authenticated, the API will respond with JSON string containing element success set to false, and element msg containing additional information on the error. 


V. Search Unit Results

A. Description
This API function is used to retrieve a list of unit information using the Enrolment ID and a date range. The start date is compared to the Unit’s Proposed Start or Actual Start date while the end date is compared to the Date Proposed for Final Assessment or Date Deemed Competent.  This needs a valid token added to the HTTP header for authorization. The RTO depends on the email address and password used to get the token.
B. Information
Method: GET
Request Header: 
Content-Type: application/json
Authorization: Bearer <token from login>
Parameters:
EnrolID: integer
StartDate: string (date in yyyy-mm-dd format)
EndDate: string (date in yyyy-mm-dd format)

Request Body: N/A
Response Body: Refer to schema/model APIResponseUnits

C. Sample Usage in PHP

$ch = curl_init();
$headers = [
    'Accept: application/json',
    'Content-Type: application/json',
    'Access-Control-Allow-Origin: *',
    'Authorization: Bearer ' . $token,
];
$curl_url = 'https://api.rto.net.au/api/SearchUnits?EnrolID=31&StartDate=2022-03-
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;
}

D. Successful
If successful, the API will respond with JSON string containing element success set to true, and element unitLst set to an array of unit information.

E. Error
If login token was not authenticated, the HTTP Code will be returned as 401 for Unauthorized. If authenticated, the API will respond with JSON string containing element success set to false, and element msg containing additional information on the error.

VI. Search LLN Completion
A. Description
This API function is used to retrieve a list of completed LLN using a date range. The system checks if the enrolment’s LLN completion date is within the supplied date range.  Needs a valid token added to the HTTP header for authorization. RTO depends on the email address and password used to get the token.

B. Information
Method: GET
Request Header: 
Content-Type: application/json
Authorization: Bearer <token from login>
Parameters:
StartDate: string (date in yyyy-mm-dd format)
EndDate: string (date in yyyy-mm-dd format)

Request Body: N/A
Response Body: Refer to schema/model APIResponseLLN

C. Sample Usage in PHP

$ch = curl_init();
$headers = [
    'Accept: application/json',
    'Content-Type: application/json',
    'Access-Control-Allow-Origin: *',
    'Authorization: Bearer ' . $token,
];
$curl_url = 'https://api.rto.net.au/api/LLNCompletion?StartDate=2022-03-
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;
}


D. 
Successful
If successful, the API will respond with JSON string containing element success set to true, and element llnLst set to an array of LLN information.

E. Error
If login token was not authenticated, the HTTP Code will be returned as 401 for Unauthorized. If authenticated, the API will respond with JSON string containing element success set to false, and element msg containing additional information on the error.


VII. Schemas / Models 

A. APIResponse 

{ 

  "success": "true", 

  "msg": "string", 

  "newId": "integer" 

} 


B. Student

{
  "success": "true",
  "msg": "string",
  "unitLst": [
{
"UnitID" = "integer",
"EnrolID" = "integer",
"CompetencyIdentifier" = "string",
"QualificationCode" = "string",
"UnitType" = "string",
"StudentID" = "integer",
"ProposedStartDate" = "string",
"ActualStartDate" = "string",
"DateDeemedCompetent" = "string",
"DateForFinalAssessment" = "string",
"GroupID" = "integer",
"OutcomeIdentifier" = "string"
}
]
}

C. APIResponseLLN

{
  "success": "true",
  "msg": "string",
  "llnLst": [
{
"studentId" = "string",
"enrolId" = "string",
"llnCompletionDate" = "string"
}
]
}

D. Student

  "victorianStudentNumber": "string",
  "educationIdentifier": "string",
  "yearHighestSchool": "string",
  "residencyStatus": "string",
  "mostRecentSchoolIdentifier": "string",
  "multpliExternalEnrolments": [
    {
      "studentRegDeliveryModeName": "string",
      "courseCode": "string",
      "studentRegAttendanceGroup": "string",
      "startDate": "string"
    }
  ],
  "usiStatus": "string",
  "educationAgentId": "string",
  "studentDeclaration": "string",
  "guardianName": "string",
  "guardianRelationship": "string",
  "guardianEmail": "string",
  "guardianHomeAddress": "string",
  "guardianBusinessHoursNumber": "string",
  "guardianAfterHoursNumber": "string",
  "guardianMobileNumber": "string",
  "guardianPostalAddress": "string",
  "minorLivingWith": "string",
  "minorLivingWithDetails": "string",
  "studentPassportStatus": "string",
  "studentIssuedBy": "string",
  "studentPassportNumber": "string",
  "studentPassportExpiryDate": "string",
  "studentInternationalRefusedVisa": "string",
  "studentVisaCountryofLodgement": "string",
  "studentVisaCityofLodgement": "string",
  "studentVisaDateofIntendedApplication": "string",
  "studentVisaType": "string",
  "studentVisaStatus": "string",
  "studentVisaNumber": "string",
  "studentVisaExpiryDate": "string",
  "studentVisaCurrentlyInAustralia": "string",
  "studentInternationalEnglishTest": "string",
  "studentHealthCoverInsurerName": "string",
  "studentHealthCoverMemberNumber": "string",
  "studentHealthCoverExpiryDate": "string",
  "studentInternationalEnglishatHome": "string",
  "studentInternationalEnglishSkills": "string",
  "studentInternationalEnglishTestDate": "string",
  "studentInternationalEnglishTestScore": "string",
  "studentInternationalEnglishTestProposedDate": "string",
  "studentEnroledWithOtherProvider": "string",
  "studentInternationalQual1Name": "string",
  "studentInternationalQual1Institute": "string",
  "studentInternationalQual1Country": "string",
  "studentInternationalQual1DateofCompletion": "string",
  "studentInternationalQual2Name": "string",
  "studentInternationalQual2Institute": "string",
  "studentInternationalQual2Country": "string",
  "studentInternationalQual2DateofCompletion": "string",
  "studentInternationalRequestedCourseCredits": "string",
  "studentInternationalEducationAgentName": "string",
  "studentInternationalEducationAgentCode": "string",
  "studentInternationalAgentBusinessAddress": "string",
  "studentInternationalAgentEmail": "string",
  "unreadMsgs": "string",
  "rtoNumber": "string",
  "paraProviderId": "string",
  "courseCode": "string",
  "courseRegistrationId": "string",
  "studyReason": "string",
  "studentRegAttendanceGroup": "string",
  "hasAccreditedCourse": "string",
  "domainName": "string",
  "studentUsername": "string",
  "studentPassword": "string",
  "studentReferralSource": "string",
  "studentRegVetinSchoolsFlag": "string",
  "studentRegDeliveryLocationIdentifier": "string",
  "studentRegEnrolmentStartDate": "string",
  "studentRegEnrolmentEndDate": "string",
  "studentRegDeliveryModeName": "string",
  "studentRegNominalDuration": "string",
  "studentRegEnrolmentExpirydate": "string",
  "studentRegEnrolmentOutcome": "string",
  "studentRegYearProgramCompleted": "string",
  "studentRegQualificationIssuedFlag": "string",
  "studentRegDateCertificateissued": "string",
  "studentRegdatestatementissued": "string",
  "studentRegDateTranscriptIssued": "string",
  "studentRegCommencingCourseIdentifierName": "string",
  "studentRegFundingSourceNationalName": "string",
  "studentRegFundingSourceSTAName": "string",
  "studentRegAssociatedcourseidentifier": "string",
  "studentRegSpecificprogramidentifier": "string",
  "studentRegFeeExemptionConcessionTypeIdentifier": "string",
  "studentRegPurchasingContractIdentifier": "string",
  "studentRegPurchasingContractScheduleIdentifier": "string",
  "studentRegTrainingContractIdentifierNewApprenticeships": "string",
  "studentRegTrainingContractIdentifierPrevious": "string",
  "studentRegClientIdentifierApprenticeships": "string",
  "studentRegDateofTrainingContractCommencement": "string",
  "studentRegDateofTrainingContractCompletion": "string",
  "studentRegTypeofApprenticeship": "string",
  "studentRegAdditionalNotesorRelevantInformation": "string",
  "studentRegEmploymentArrangement": "string",
  "studentRegExistingWorkerFlag": "string",
  "studentRegSchoolBasedFlag": "string",
  "studentRegFulltimeorparttime": "string",
  "studyReasonIdentifierName": "string",
  "studentRegEnrolmentID": "string",
  "studentFundingSourceNational": "string",
  "studentSpecificProgramIdentifier": "string",
  "studentSchoolTypeIdentifier": "string",
  "lmsAccess": "string",
  "student_number": 0,
  "previousStudentID": "string",
  "studentID": 0,
  "studentTitle": "string",
  "studentPreferredName": "string",
  "studentName": "string",
  "studentSurname": "string",
  "studentMiddleName": "string",
  "studentNumber": "string",
  "studentDOB": "string",
  "studentGender": "string",
  "studentCountryOfBirth": "string",
  "studentHomeNumber": "string",
  "studentMobileNumber": "string",
  "studentWorkNumber": "string",
  "studentInternationalNumber": "string",
  "studentEmail": "string",
  "studentEmailAlt": "string",
  "studentSurvery": "string",
  "studentOverseas": "string",
  "studentIndividualNeedsInfo": "string",
  "studentPropertyName": "string",
  "studentFlatNumber": "string",
  "studentStreetNumber": "string",
  "studentStreetName": "string",
  "studentSuburb": "string",
  "studentPostcode": "string",
  "studentState": "string",
  "studentCountryOfResidence": "string",
  "studentPostalPropertyName": "string",
  "studentPostalFlatNumber": "string",
  "studentPostalStreetNumber": "string",
  "studentPostalStreetName": "string",
  "studentPostalBox": "string",
  "studentPostalSuburb": "string",
  "studentPostalPostcode": "string",
  "studentPostalState": "string",
  "studentEducationAtSchool": "string",
  "studentEducationSchoolLevelIdentifier": "string",
  "studentPriorEducationFlag": "string",
  "studentEducationAdvancedDiploma": "string",
  "studentEducationBachelorDegree": "string",
  "studentEducationCertificateI": "string",
  "studentEducationCertificateII": "string",
  "studentEducationCertificateIII": "string",
  "studentEducationCertificateIV": "string",
  "studentEducationDiploma": "string",
  "studentEducationMiscEducation": "string",
  "studentPriorEducationFlagAE": "string",
  "studentEducationAdvancedDiplomaAE": "string",
  "studentEducationBachelorDegreeAE": "string",
  "studentEducationCertificateIAE": "string",
  "studentEducationCertificateIIAE": "string",
  "studentEducationCertificateIIIAE": "string",
  "studentEducationCertificateIVAE": "string",
  "studentEducationDiplomaAE": "string",
  "studentEducationMiscEducationAE": "string",
  "studentPriorEducationFlagInternational": "string",
  "studentEducationAdvancedDiplomaInternational": "string",
  "studentEducationBachelorDegreeInternational": "string",
  "studentEducationCertificateIInternational": "string",
  "studentEducationCertificateIIInternational": "string",
  "studentEducationCertificateIIIInternational": "string",
  "studentEducationCertificateIVInternational": "string",
  "studentEducationDiplomaInternational": "string",
  "studentEducationMiscEducationInternational": "string",
  "studentIndividualIndigenousStaus": "string",
  "studentIndividualEmploymentStaus": "string",
  "studentIndividualMainLanguageSpokenAtHome": "string",
  "studentUniqueStudentIdentifier": "string",
  "studenDisabilityFlag": "string",
  "studentIndividualHearing": "string",
  "studentIndividualPhysical": "string",
  "studentIndividualIntellectual": "string",
  "studentIndividualLearning": "string",
  "studentIndividualMentalIllness": "string",
  "studentIndividualAcquiredBrainImpairment": "string",
  "studentIndividualVision": "string",
  "studentIndividualMedicalCondition": "string",
  "studentIndividualOther": "string",
  "studentRegWelfareEmergencyContact": "string",
  "studentRegWelfareRelationship": "string",
  "studentRegWelfareEmail": "string",
  "studentRegWelfareMobilePhone": "string",
  "studentRegWelfareBusinessPhone": "string",
  "studentRegWelfareHomePhone": "string",
  "studentRegWelfareComments": "string",
  "studentRegWelfareDoctorsName": "string",
  "studentRegWelfareDoctorsContactNumber": "string",
  "studentRegWelfareMedicateNumber": "string",
  "studentRegWelfareHealthInsurer": "string",
  "studentRegWelfareHeathInsurerNumber": "string",
  "studentRegWelfareAllegories": "string",
  "studentRegWelfareMedications": "string",
  "studentRegChose": "string",
  "studentRegTownCityofBirth": "string",
  "studentRegcountrystudyingin": "string",
  "studentRegCountryofresidenceforUSI": "string",
  "studentRegPermittedUSIExemptionConfirmed": "string",
  "studentRegDVSCheckRequiredOverridePermission": "string",
  "studentRegDVSDocumenttyperequired": "string",
  "studentRegBirthcertificateRegNumber": "string",
  "studentRegbirthcertificateregstate": "string",
  "studentRegBirthcertificateregdate": "string",
  "studentRegBirthCertificateRegYear": "string",
  "studentRegBirthcertificatedateprinted": "string",
  "studentRegBirthCertificatenumber": "string",
  "studentRegDescentdocumentstocknumber": "string",
  "studentRegDescentdocumentacquisitionDate": "string",
  "studentRegCitizenshipCertStocknumber": "string",
  "studentRegCitizenshipAcquisitiondate": "string",
  "studentRegDriverslicencenumber": "string",
  "studentRegDriverslicencestate": "string",
  "studentRegpassportdocumentnumber": "string",
  "studentRegCountryOfIssue": "string",
  "studentRegMedicareCardnumber": "string",
  "studentRegIndividualRefNumber": "string",
  "studentRegMedicareCardColour": "string",
  "studentRegMedicareExpiryDate": "string",
  "studentRegMedicareName": "string",
  "studentRegImmiCardNumber": "string",
  "studentHealthCoverInsurerCost": "string",
  "studentStat1": "string",
  "studentStat2": "string",
  "learnerUniqueIdentifier": "string",
  "clientIndustryofEmployment": "string",
  "clientOccupationIdentifier": "string",
  "eligibilityExemptionIndicator": "string",
  "fundingEligibilityKey": "string",
  "enrolledSchoolIdentifier": "string",
  "currentSchoolLevelIdentifier": "string",
  "trainingTypeIdentifier": "string",
  "specificFundingIdentifier": "string"
}


    • Related Articles

    • SMS Stripe Integration

      I. Retrieve Stripe API Keys  Upon registration to Stripe, a total of four keys will be provided: a publishable and secret key pair for test and live modes (when account is activated). Keys can be found under API Keys page in the Developers ...
    • Connecting SMS Programs Instance to LMS Courses

      Overview There are two ways to integrate your SMS Programs to your LMS courses. The method you choose depends on the way your program is set up in your LMS. Please read the descriptions of the two types of connectivity you can set below, to determine ...
    • How to Add a Program in the SMS

      Navigation Instruction: You may refer to the tables below to learn more about the different fields and their functions in the SMS. Programs - Scope Information SMS Field Function Program code Nationally Accredited Programs Place the Code of the ...
    • How to Generate Units Report in SMS

      Navigation Instruction: To generate Units Report in your SMS, follow the steps below:
    • How to Generate a Certificate Report in the SMS

      Navigation Instruction: To generate a Certificate Report in your SMS, follow the steps below: