Skip to content

Latest commit

 

History

History
433 lines (317 loc) · 19.5 KB

api.md

File metadata and controls

433 lines (317 loc) · 19.5 KB

smartschool-client

De module smartschool-client voorziet een aantal functies die een subset van de Smartschool SOAP API implementeren, met de focus op gebruikers en groepen/klassen. Het biedt een zeer flexibele en vereenvoudigde manier om data uit Smartschool op te halen met nodeJS.

smartschool-client.SmartSchoolServiceError

Custom Error class die een error van de Smartschool service representeert

Kind: static class of smartschool-client

new SmartSchoolServiceError(message, code)

Constructor

Param Type
message string
code string | number

smartschool-client.SOAPError

Custom Error class die een SOAP error representeert

Kind: static class of smartschool-client

new SOAPError(message)

Constructor

Param Type
message string

smartschool-client.SmartSchoolClientError

Smartschool-client error

Kind: static class of smartschool-client

new SmartSchoolClientError(message)

Constructor

Param Type
message string

smartschool-client.init(options) ⇒ Promise

Initialiseren van de smartschool-client API module

Kind: static method of smartschool-client

Param Type Description
options object
options.apiWSDL string 'https://jouwschool.smartschool.be/Webservices/V3?wsdl'
options.accessCode string Code geconfigureerd in je SmartSchool platform in Algemene Configuratie > Webservices

smartschool-client.getUser(options) ⇒ Promise.<Object>

Met deze methode kan je alle velden (behalve wachtwoorden en profielfoto) en de groepslidmaatschappen van een specifieke gebruiker ophalen.

Kind: static method of smartschool-client
See

Param Type Description
options object
options.userId string | number Gebruikersnaam of intern nummer gebruiker
[options.transformation] object

smartschool-client.createUser(options) ⇒ Promise

Voegt een nieuwe gebruiker toe.

Note: Niet alle mogelijke velden van Smartschool zijn geïmplementeerd in deze functie.

Note2: De gebruiker wordt standaard toegevoegd aan de groep geconfigureerd in de Webservices pagina van Smartschool in het veld doelgroep. Als je een gebruiker aan een andere groep wilt toekennen, gebruik dan removeUserFromGroup en vervolgens addUserToGroup om de gebruiker te verplaatsen.

Kind: static method of smartschool-client
See: ./examples/02_create_user.js

Param Type Default Description
options object
options.userName string Gebruikersnaam
options.password string Paswoord
options.firstName string Voornaam
options.lastName string Achternaam
[options.registrationNumber] string stamboeknummer
[options.internalNumber] string Intern nummer
[options.gender] string "m" Geslacht
[options.role] string "andere" Basisrol
[options.birthDate] string Geboortedatum. Formaat YYYY-MM-DD of DD-MM-YYYY
[options.email] string E-mail adres
[options.roosterCode] string Roostercode (untis)
[options.mobilePhone] string Mobiel nummer

smartschool-client.updateUser(options) ⇒ Promise

Update een bestaande gebruiker.

Note 1: Niet alle mogelijke velden van Smartschool zijn geïmplementeerd in deze functie.

Note 2: Voor update gebruikersnaam, zie updateUserName

Note 3: Voor update paswoord, zie updateUserPassword

Kind: static method of smartschool-client
See: ./examples/03_update_user.js

Param Type Description
options object
options.userName string Gebruikersnaam
[options.firstName] string Voornaam
[options.lastName] string Achternaam
[options.internalNumber] string Intern nummer
[options.gender] string Geslacht
[options.role] string Basisrol
[options.birthDate] string Geboortedatum. Formaat YYYY-MM-DD of DD-MM-YYYY
[options.email] string E-mail adres

smartschool-client.updateUserName(options) ⇒ Promise

Update gebruikersnaam. Kan alleen als er een intern nummer is ingevuld in Smartschool.

Kind: static method of smartschool-client
See: ./examples/04_update_user_name.js

Param Type Description
options object
options.internalNumber string Intern nummer
options.newUserName string Nieuwe gebruikersnaam

smartschool-client.updateUserPassword(options) ⇒ Promise

Update paswoorden Hoofd- en co-accounts gebruiker.

Kind: static method of smartschool-client
See: ./examples/05_update_user_password.js

Param Type Default Description
options object
options.userName string Gebruikersnaam
options.password string Nieuw paswoord
[options.accountType] number 0 Accounttype:'0' = hoofdaccount, '1' = co-account 1 of '2' = co-account 2 ...)

smartschool-client.setUserStateActive(options) ⇒ Promise

Zet de status van een gebruiker op actief

Kind: static method of smartschool-client
See: ./examples/06_set_user_state.js

Param Type Description
options object
options.userName string Gebruikersnaam

smartschool-client.setUserStateInactive(options) ⇒ Promise

Zet de status van een gebruiker op inactief

Kind: static method of smartschool-client
See: ./examples/06_set_user_state.js

Param Type Description
options object
options.userName string Gebruikersnaam

smartschool-client.setUserStateAdministrative(options) ⇒ Promise

Zet de status van een gebruiker op administratief

Kind: static method of smartschool-client
See: ./examples/06_set_user_state.js

Param Type Description
options object
options.userName string Gebruikersnaam

smartschool-client.addUserToGroup(options) ⇒ Promise

Voegt een gebruiker toe aan een groep of klas.

Kind: static method of smartschool-client
See: ./examples/07_user_group.js

Param Type Description
options object
options.userName string Gebruikersnaam
options.groupOrClassId string Groep of klas code

smartschool-client.removeUserFromGroup(options) ⇒ Promise

Verwijdert een gebruiker uit een groep of klas.

Kind: static method of smartschool-client
See: ./examples/07_user_group.js

Param Type Description
options object
options.userName string Gebruikersnaam
options.groupOrClassId string Groep of klas code

smartschool-client.getUsers([options]) ⇒ Promise.<Array.<Object>>

Haalt alle unieke gebruikers van het platform op met alle beschikbare velden. Als de groepCode is opgegegeven, worden enkel de gebruikers van deze groep opgehaald. De groepen waartoe de gebruiker behoort kan je vinden in het veld groups als een Array van strings

Kind: static method of smartschool-client
See

Param Type Default Description
[options] object {}
[options.groupId] string Unieke klas- of groepscode van de op te halen groep
[options.recursive] bool true Subgroepen ophalen?
[options.transformation] object

smartschool-client.getClasses([options]) ⇒ Promise.<Array.<Object>>

Haalt een lijst met alle klassen op.

Kind: static method of smartschool-client
See: ./examples/11_get_classes.js

Param Type Default
[options] object {}
[options.transformation] object

smartschool-client.getGroup([options]) ⇒ Promise.<Object>

Haalt een groep of klas op uit het Smartschoolplatform.

Kind: static method of smartschool-client
See: ./examples/12_get_group.js

Param Type Default Description
[options] object {}
options.groupOrClassId string // group/class code
[options.transformation] object

smartschool-client.getGroups([options]) ⇒ Promise.<Array.<Object>> | Promise.<Object>

Haalt alle groepen en klassen van het Smartschoolplatform. Als options.flat=false wordt er een object als boomstructuur geretourneerd. options.transformation is niet ondersteund in dit geval.

Kind: static method of smartschool-client
Returns: Promise.<Array.<Object>> | Promise.<Object> - null als niet gevonden
See

Param Type Default Description
[options] object {}
[options.flat] boolean true
[options.groupId] string Als opgegeven: deze groep en alle children
[options.transformation] object

smartschool-client.createGroup(options) ⇒ Promise

Voegt een nieuwe groep toe.

Kind: static method of smartschool-client
See: ./examples/15_create_group.js

Param Type Description
options object
options.groupId string Groepsnaam of code
[options.description] string Omschrijving
[options.parent] string Unieke klas-of groepscode van parent groep. Op hoogste niveau als weggelaten.
[options.untis] string Koppelingsvelds schoolagenda

smartschool-client.updateGroup(options) ⇒ Promise

Wijzigt een groep.

Note: Hiermee kan je geen groepen in de groepenstructuur verplaatsen! Het wijzigen van de parent heeft geen effect. > vraag aan Smartschool team

Kind: static method of smartschool-client
See: ./examples/16_update_group.js

Param Type Description
options object
options.groupId string Groepsnaam of code
[options.description] string Omschrijving
[options.parent] string Unieke klas-of groepscode van parent groep. Op hoogste niveau als weggelaten.
[options.untis] string Koppelingsveld schoolagenda

smartschool-client.getUserPhoto(userName) ⇒ Promise.<string>

Met deze methode kan je de foto van een gebruiker ophalen als base64 encoded string in jpeg formaat

Kind: static method of smartschool-client
See: ./examples/17_get_user_photo.js

Param Type Description
userName string Gebruikersnaam

smartschool-client.setUserPhoto(userName, photo) ⇒ Promise

Met deze methode kan je de foto van een gebruiker uploaden naar Smartschool als base64 encoded string in jpeg formaat

Kind: static method of smartschool-client

Param Type Description
userName string Gebruikersnaam
photo string Base64 encode string jpeg

smartschool-client.sendMessage(options) ⇒ Promise

Via deze methode kan je een bericht naar de hoofdaccount of een co-account van een bepaalde gebruiker sturen. Het opgeven van de bijlage is optioneel. CopyToLVS niet geïmplementeerd Attachements toevoegen [ { “filename”: “test1.docx”, “filedata”: “base64encoded string” }, { “filename”: “test2.docx”, “filedata”: “base64encoded string” } ]

Kind: static method of smartschool-client
See

Param Type Default Description
options object
options.userName string Gebruikersnaam
options.title string Titel van het bericht
options.body string Tekst van het bericht
[options.fromUser] string "'Null'" Uniek veld gebruiker van de verzender. Geef 'Null' mee om geen verzender in te stellen
[options.accountType] number 0 Accounttype:'0' = hoofdaccount, '1' = co-account 1 of '2' = co-account 2 ...)
[options.attachments] Array.<Object> [] Bijlagen (1 of meer) in base64 encoding (optioneel)