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
- .SOAPError
- .SmartSchoolClientError
- .init(options) ⇒
Promise
- .getUser(options) ⇒
Promise.<Object>
- .createUser(options) ⇒
Promise
- .updateUser(options) ⇒
Promise
- .updateUserName(options) ⇒
Promise
- .updateUserPassword(options) ⇒
Promise
- .setUserStateActive(options) ⇒
Promise
- .setUserStateInactive(options) ⇒
Promise
- .setUserStateAdministrative(options) ⇒
Promise
- .addUserToGroup(options) ⇒
Promise
- .removeUserFromGroup(options) ⇒
Promise
- .getUsers([options]) ⇒
Promise.<Array.<Object>>
- .getClasses([options]) ⇒
Promise.<Array.<Object>>
- .getGroup([options]) ⇒
Promise.<Object>
- .getGroups([options]) ⇒
Promise.<Array.<Object>>
|Promise.<Object>
- .createGroup(options) ⇒
Promise
- .updateGroup(options) ⇒
Promise
- .getUserPhoto(userName) ⇒
Promise.<string>
- .setUserPhoto(userName, photo) ⇒
Promise
- .sendMessage(options) ⇒
Promise
Custom Error class die een error van de Smartschool service representeert
Kind: static class of smartschool-client
Constructor
Param | Type |
---|---|
message | string |
code | string | number |
Custom Error class die een SOAP error representeert
Kind: static class of smartschool-client
Constructor
Param | Type |
---|---|
message | string |
Smartschool-client error
Kind: static class of smartschool-client
Constructor
Param | Type |
---|---|
message | string |
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 |
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 |
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 |
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 |
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 |
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 ...) |
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 |
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 |
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 |
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 |
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 |
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
- ./examples/08_get_users.js
- ./examples/09_get_users_in_group.js
- ./examples/10_get_users_in_group_transform.js
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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) |