magister-api / magister Goto Github PK
View Code? Open in Web Editor NEWAn eloquent API for Schoolmaster BV's Magister 6.
License: MIT License
An eloquent API for Schoolmaster BV's Magister 6.
License: MIT License
Als ik een instantie aanmaak en die open met http://localhost:8080/ krijg ik de foutmelding na het openen van het php bestand:
'Fatal error: Uncaught exception 'GuzzleHttp\Ring\Exception\ConnectException' with message 'cURL error 6: See http://curl.haxx.se/libcurl/c/libcurl-errors.html' in E:\Profielwerkstuk - kopie\vendor\guzzlehttp\ringphp\src\Client\CurlFactory.php:126 Stack trace: #0 E:\Profielwerkstuk - kopie\vendor\guzzlehttp\ringphp\src\Client\CurlFactory.php(91): GuzzleHttp\Ring\Client\CurlFactory::createErrorResponse(Object(GuzzleHttp\Ring\Client\CurlMultiHandler), Array, Array) #1 E:\Profielwerkstuk - kopie\vendor\guzzlehttp\ringphp\src\Client\CurlMultiHandler.php(244): GuzzleHttp\Ring\Client\CurlFactory::createResponse(Object(GuzzleHttp\Ring\Client\CurlMultiHandler), Array, Array, Array, Resource id #120) #2 E:\Profielwerkstuk - kopie\vendor\guzzlehttp\ringphp\src\Client\CurlMultiHandler.php(136): GuzzleHttp\Ring\Client\CurlMultiHandler->processMessages() #3 E:\Profielwerkstuk - kopie\vendor\guzzlehttp\ringphp\src\Future\BaseFutureTrait.php(118): GuzzleHttp\Ring\Client\CurlMultiHandler->execute() #4 E:\Profielwerkstuk - kopie\vendor\guz in E:\Profielwerkstuk - kopie\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php on line 49'
Door gebrek aan tijd werken wij momenteel niet veel aan de API. In de nabije toekomst zijn we van plan om dit weer op te pakken. In de tussentijd houden we een oogje in het zeil en zullen we updates uitvoeren indien noodzakelijk.
Wat de website betreft, deze zal binnenkort weer online komen. De documentatie heeft een zeer hoge prioriteit en zal tegen die tijd grondig onder handen genomen worden.
Voor vragen en suggesties zijn Christopher (KickWood) en ik altijd bereikbaar.
Hi,
When trying to install your package I run into the following error:
- stanvk/magister dev-master requires filp/whoops ^1.2@dev -> no matching package found.
When I look at the whoops package (https://packagist.org/packages/filp/whoops) I also noticed the latest version is 1.1.6. Can you please fix this dependency?
Thanks!
Obviously the documentation is not usable or easily interpretabel by new users, nor is it finished. It barely names all the functions of the API, let alone how to use them.
Since I want to fully focus on the code I could use some help with the documentation.
Feel free to contribute at magister-api/docs (see https://github.com/magister-api/docs)
In mijn REST API tooltje zie ik dat ik geen informatie meer mag opvragen van Magister. Ik krijg bijvoorbeeld op het pad api/leerlingen/{nummertje}
nu de response OnvoldoendePrivileges
met omschrijving null
.
Op api/accounts/{id}
krijg ik nu softtokenStatus = 'nietGekoppeld'
. Klinkt mij in de oren als een OAuth systeempje wat ze nu implementeren? De school waar ik mee test gebruikt Magister v6.0.27.
At the moment, the documentation is not very apprehensive and the overall design is not very attractive. I hope this will be sorted out when version 2.1.0 is released.
Website van de documentatie is offline, kunnen jullie hier wat aan doen?
Only variables should be passed by reference in /home/vagrant/Code/magister/src/Magister/Repositories/AbstractRepository.php on line
Code at this line is:
return array_pop($this->get());
The error probably gets triggered when the parameter for that specific function is not an array.
Just ran into an issue with the latest master. Tracked it down to the dictionary.php:
Magister\Models\Course
(and possibly other models as well)I've made a small test script to illustrate the differences:
<?php
require(__DIR__ . '/vendor/autoload.php');
$magister = new Magister\Magister('...', '...', ...');
$course = Magister\Models\Course::first();
$tests = [
'var_dump($course->getKeyName());',
'var_dump($course->getKey());',
'var_dump($course->id);',
'var_dump($course->Id);',
'var_dump($course["id"]);',
'var_dump($course["Id"]);',
'var_dump($course->ToArray()["id"]);',
'var_dump($course->afkorting);',
];
foreach ($tests as $test) {
echo "{$test}\n ";
eval($test);
}
Up until 8894ee6, this resulted in:
var_dump($course->getKeyName());
string(2) "Id"
var_dump($course->getKey());
NULL
var_dump($course->id);
int(1422343)
var_dump($course->Id);
NULL
var_dump($course["id"]);
int(1422343)
var_dump($course["Id"]);
NULL
var_dump($course->ToArray()["id"]);
int(1422343)
var_dump($course->afkorting);
string(5) "AdAth"
It looks like there was already an issue with #getKey()
using Id
as a key name, instead of id
, but perhaps this was affecting Magister\Models\Course
only. But at least getting the ID using ->id
worked.
In a73c775 and later, this no longer works:
var_dump($course->getKeyName());
string(2) "Id"
var_dump($course->getKey());
NULL
var_dump($course->id);
NULL
var_dump($course->Id);
NULL
var_dump($course["id"]);
NULL
var_dump($course["Id"]);
NULL
var_dump($course->ToArray()["id"]);
int(1422343)
var_dump($course->afkorting);
string(5) "AdAth"
As you can see, the only way of getting the id property was by using #ToArray()
. Other properties (like afkorting
) are still working properly.
De link magister-api.nl staat nog in de repo (bij de beschrijving), maar is (lijkt me) niet meer van dit project.
wordt deze api nog ondersteund?
Is this api still up to date or are there now (better) alternatives?
Er lijkt wederom een nieuwe magister update plaats te hebben gevonden, namelijk die naar 6.1.11...
Ook deze update lijkt ervoor gezorgt te hebben dat de API niet meer werkt, ik zal vanavond even dieper in de code duiken of ik kan vinden waarom...
Persoonlijk krijg ik bij elke school die via mijn applicatie aangesloten is de "cURL error 6: Could not resolve host:" error..
( Er was sinds gister al een probleem, toen was de error wel nog anders! Toen kreeg ik een error op een array_key_exists functie waarbij ergens een tweede argument geen array meer was maar een string...)
Graag hoor ik of andere mensen ook dit probleem hebben en of iemand misschien op basis van deze errors gelijk een oplossing weet!
Ik wil graag de Magister API gebruiken, maar mijn webhosting ondersteunt alleen (S)FTP, en geen terminal. Is er een manier waarop ik de API toch kan gebruiken?
I'm writing my own API for Magister in Java and I'm wondering how to retreive the Authorization key via login. I'm able to retreive the key from the Authorization header in the browser but there are two problems:
I want to automate the procress with a simple login script but I've no idea on how to do that. Can anyone list the steps required for getting the authorization key.
Thanks,
Thomas
I received a message from magister that there will be a major update. Will you provide support for this or will there be no more development?
Is er een manier om bij leermiddelen te komen? als ik json_decode(Http::get("personen/$id/digitaallesmateriaal/Ean/EANCODE")->getBody());
gebruik krijg ik NULL
terug, geen invalid url
of geen rechten
.
Is er een mogelijkheid om de weging van de cijfers mee te krijgen?
Groet,
Joep de Jong
Messages werken niet want de url in url.php is verkeerd (dus heb die veranderd) alleen hij veranderd de ':message' niet naar de id van het bericht.
Unfortunately Schoolmaster BV has decided to authorise all incoming API requests. That does not mean that this API does not work anymore. It does mean however that you need an API key in order to get access to the data.
I will take a look at this. I guess it will be necessary to have an API key now, so probably there will be an option to feed your magister API key and gain access again.
Magister\Models\Appointment::today() is een array en ik snap dat je met een foreach loop data eruit kan halen.
foreach (Magister\Models\Appointment::today() as $appointment) {
echo $appointment->Omschrijving;
}
Maar nu zie ik dat als ik var_dump(Magister\Models\Appointment::today())
doe er ook "dieperliggende" data is:
["Vakken"] => array(1) {
[0] => array(2) {
["Id"] => int(81)
["Naam"] => string(22) "Wiskunde"
}
}
Hoe verkrijg ik die data?
Ohja en wanneer komt de verbeterde documentatie uit?
Hello,
I have noticed that on some schools using Magister, they only provide an account for the parents. The students see their time table on their parent's account. I've tried getting data when logging in as a parent, but without much success. You are able to get some information, but not for example your homework. I guess it has something to do with being able to have multiple students on the same school, all linked to the parent's account. Do I need to do something different to get things like homework assignments from a parent's account or is it just not possible?
For a little while now (maybe a week?) I'm getting issues from this library, even though it was working perfectly before and no changes were made. After updating to the latest release, it still won't work.
The underlying problem seems to be a 404 response to the POST to /api/sessie
, which seems to suggest an API change on the Magister side. I'm not sure if this applies to all schools already, or just the one I'm using (stanislas.magister.net).
It seems the JavaScript implementation (https://github.com/simplyGits/MagisterJS) does still work. It's using a POST to /api/sessies
instead, but it looks like it also needs an application/json POST body.
Any idea if the API has changed recently?
Hey there,
It seems there was a Magister update recently,
My application runs for almost a year without a problem and now it got error's all over the place
cURL error 60: SSL certificate problem: self signed certificate in certificate chain
StackTrace
#1 .\vendor\guzzlehttp\guzzle\src\RequestFsm.php(132): GuzzleHttp\RequestFsm->__invoke(Object(GuzzleHttp\Transaction))
#2 .\vendor\react\promise\src\FulfilledPromise.php(25): GuzzleHttp\RequestFsm->GuzzleHttp\{closure}(Array)
#3 .\vendor\guzzlehttp\ringphp\src\Future\CompletedFutureValue.php(55): React\Promise\FulfilledPromise->then(Object(Closure), NULL, NULL)
#4 .\vendor\guzzlehttp\guzzle\src\Message\FutureResponse.php(43): GuzzleHttp\Ring\Future\CompletedFutureValue->then(Object(Closure), NULL, NULL)
#5 .\vendor\guzzlehttp\guzzle\src\RequestFsm.php(135): GuzzleHttp\Message\FutureResponse::proxy(Object(GuzzleHttp\Ring\Future\CompletedFutureArray), Object(Closure))
#6 .\vendor\guzzlehttp\guzzle\src\Client.php(165): GuzzleHttp\RequestFsm->__invoke(Object(GuzzleHttp\Transaction))
#7 .\vendor\guzzlehttp\guzzle\src\Client.php(135): GuzzleHttp\Client->send(Object(GuzzleHttp\Message\Request))
#8 .\vendor\stanvk\magister\src\Magister\Services\Auth\ElegantUserProvider.php(70): GuzzleHttp\Client->delete('sessies/huidige')
#9 .\vendor\stanvk\magister\src\Magister\Services\Auth\Guard.php(140): Magister\Services\Auth\ElegantUserProvider->retrieveByCredentials(Array)
#10 [internal function]: Magister\Services\Auth\Guard->attempt(Array)
#11 .\vendor\stanvk\magister\src\Magister\Services\Support\Manager.php(101): call_user_func_array(Array, Array)
#12 .\vendor\stanvk\magister\src\Magister\Services\Auth\AuthServiceProvider.php(45): Magister\Services\Support\Manager->__call('attempt', Array)
#13 .\vendor\stanvk\magister\src\Magister\Services\Auth\AuthServiceProvider.php(45): Magister\Services\Auth\AuthManager->attempt(Array)
#14 .\vendor\stanvk\magister\src\Magister\Magister.php(180): Magister\Services\Auth\AuthServiceProvider->boot()
#15 .\vendor\stanvk\magister\src\Magister\Magister.php(164): Magister\Magister->bootProvider(Object(Magister\Services\Auth\AuthServiceProvider))
#16 [internal function]: Magister\Magister->Magister\{closure}(Object(Magister\Services\Auth\AuthServiceProvider), 6)
#17 .\vendor\stanvk\magister\src\Magister\Magister.php(165): array_walk(Array, Object(Closure))
#18 .\vendor\stanvk\magister\src\Magister\Services\Foundation\Bootstrap\BootProviders.php(21): Magister\Magister->boot()
#19 .\vendor\stanvk\magister\src\Magister\Magister.php(104): Magister\Services\Foundation\Bootstrap\BootProviders->bootstrap(Object(Magister\Magister))
#20 .\vendor\stanvk\magister\src\Magister\Services\Foundation\Http\Kernel.php(50): Magister\Magister->bootstrapWith(Array)
#21 .\vendor\stanvk\magister\src\Magister\Magister.php(61): Magister\Services\Foundation\Http\Kernel->bootstrap()
#22 .\app\commands\MagisterImport.php(84): Magister\Magister->__construct('hermannwesselin...', '...', '...')
#23 .\app\commands\MagisterImport.php(44): MagisterImport->magisterImport(Object(Student))
#24 .\vendor\laravel\framework\src\Illuminate\Console\Command.php(112): MagisterImport->fire()
#25 .\vendor\symfony\console\Command\Command.php(261): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#26 .\vendor\laravel\framework\src\Illuminate\Console\Command.php(100): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#27 .\vendor\symfony\console\Application.php(843): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#28 .\vendor\symfony\console\Application.php(188): Symfony\Component\Console\Application->doRunCommand(Object(MagisterImport), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#29 .\vendor\symfony\console\Application.php(119): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#30 .\artisan(59): Symfony\Component\Console\Application->run()
#31 {main}
On my side:
{
foreach (Student::all() as $student) {
if ($student->school->is_magister === 1) {
$this->magisterImport($student);
}
}
}
$magister = new Magister\Magister($student->magister_link, $student->magister_username, $student->magister_password);
Can login manually with credentials
I am on "stanvk/magister": "dev-master"
2015-11-182015-12-10
Magister agenda
exception 'GuzzleHttp\Exception\ParseException' with message 'Unable to parse JSON data: JSON_ERROR_SYNTAX - Syntax error, malformed JSON' in /var/www/html/magister-agenda/vendor/guzzlehttp/guzzle/src/Message/Response.php:148 Stack trace: #0 /var/www/html/magister-agenda/vendor/stanvk/magister/src/Magister/Services/Database/Connection.php(83): GuzzleHttp\Message\Response->json() #1 /var/www/html/magister-agenda/vendor/stanvk/magister/src/Magister/Services/Database/Connection.php(147): Magister\Services\Database\Connection->Magister\Services\Database\{closure}(Object(Magister\Services\Database\Connection), 'personen/:id/af...', Array) #2 /var/www/html/magister-agenda/vendor/stanvk/magister/src/Magister/Services/Database/Connection.php(123): Magister\Services\Database\Connection->runQueryCallback('personen/:id/af...', Array, Object(Closure)) #3 /var/www/html/magister-agenda/vendor/stanvk/magister/src/Magister/Services/Database/Connection.php(84): Magister\Services\Database\Connection->run('personen/:id/af...', Array, Object(Closure)) #4 /var/www/html/magister-agenda/vendor/stanvk/magister/src/Magister/Services/Database/Query/Builder.php(122): Magister\Services\Database\Connection->select('personen/:id/af...', Array) #5 /var/www/html/magister-agenda/vendor/stanvk/magister/src/Magister/Services/Database/Query/Builder.php(112): Magister\Services\Database\Query\Builder->runSelect() #6 /var/www/html/magister-agenda/vendor/stanvk/magister/src/Magister/Services/Database/Elegant/Builder.php(106): Magister\Services\Database\Query\Builder->get() #7 /var/www/html/magister-agenda/vendor/stanvk/magister/src/Magister/Services/Database/Elegant/Builder.php(65): Magister\Services\Database\Elegant\Builder->getModels() #8 /var/www/html/magister-agenda/getMagister.php(31): Magister\Services\Database\Elegant\Builder->get() #9 /var/www/html/magister-agenda/test_oud.php(22): getMagisterData('xxx', 'xxx', 'xxx', Array) #10 {main} Next exception 'Magister\Services\Database\QueryException' with message 'Unable to parse JSON data: JSON_ERROR_SYNTAX - Syntax error, malformed JSON (Query: personen/:id/afspraken, Array ( [van] => 2015-11-18 [tot] => 2015-12-10 ) )' in /var/www/html/magister-agenda/vendor/stanvk/magister/src/Magister/Services/Database/Connection.php:154 Stack trace: #0 /var/www/html/magister-agenda/vendor/stanvk/magister/src/Magister/Services/Database/Connection.php(123): Magister\Services\Database\Connection->runQueryCallback('personen/:id/af...', Array, Object(Closure)) #1 /var/www/html/magister-agenda/vendor/stanvk/magister/src/Magister/Services/Database/Connection.php(84): Magister\Services\Database\Connection->run('personen/:id/af...', Array, Object(Closure)) #2 /var/www/html/magister-agenda/vendor/stanvk/magister/src/Magister/Services/Database/Query/Builder.php(122): Magister\Services\Database\Connection->select('personen/:id/af...', Array) #3 /var/www/html/magister-agenda/vendor/stanvk/magister/src/Magister/Services/Database/Query/Builder.php(112): Magister\Services\Database\Query\Builder->runSelect() #4 /var/www/html/magister-agenda/vendor/stanvk/magister/src/Magister/Services/Database/Elegant/Builder.php(106): Magister\Services\Database\Query\Builder->get() #5 /var/www/html/magister-agenda/vendor/stanvk/magister/src/Magister/Services/Database/Elegant/Builder.php(65): Magister\Services\Database\Elegant\Builder->getModels() #6 /var/www/html/magister-agenda/getMagister.php(31): Magister\Services\Database\Elegant\Builder->get() #7 /var/www/html/magister-agenda/test_oud.php(22): getMagisterData('xxx', 'xxx', 'xxx', Array) #8 {main}`
try {
$magister = new Magister($school, $username, $passwo$
}
catch (Exception $e) {
echo '<br><br>';
echo 'Magister inlog';
echo '<br><br>';
echo $e;
echo '<br><br>';
}
try {
$appointments = Appointment::where('van', $begin)->where('to$
echo $appointments;
$result = json_decode($appointments, true);
} catch (Exception $e) {
echo '<br><br>';
echo 'Magister agenda';
echo '<br><br>';
echo $e;
echo '<br><br>';
return $e;
}
Vorige week werkte onze implentatie van onze huiswerk ophaal module nog naar behoren. Maar er lijkt iets te zijn veranderd, wij krijgen deze error. Zoals je ziet, lukt het inloggen wel, maar de magister agenda zelf niet.
php --version
PHP 5.6.17-0+deb8u1 (cli) (built: Jan 15 2016 15:55:17)
cat composer.json
{
"require": {
"stanvk/magister": "~2.0"
}
}
I'm pretty far already so perhaps you could join me in developping it further instead of reinventing the wheel.
https://github.com/tkon99/Magister6.php
Mogelijk is dit niet de plek maar ik zoek een beginnetje. Is er ms een voorbeeldstukje code waar wat gegevens worden uitgelezen o.i.d. zodat ik weet wat er allemaal aangeroepen moet worden
Waarom is dat openssl programma installeren zo'n pain in the ass? Kan iemand me helpen met het maken van een ssl key om de api te gebruiken?
Hello again,
Magister version 6.0.26 seems to have implemented a cooldown period before you area able to request information again. Are there any work arounds known?
in src/Magister/Services/Encryption/Encrypter.php, line 122
The
or
operator does not have the same precedence as||
.
This could lead to unexpected behavior, use||
instead.
*/
protected function getJsonPayload($payload)
{
$payload = json_decode(base64_decode($payload), true);
if ( ! $payload or $this->invalidPayload($payload))
{
throw new DecryptException("Invalid data.");
}
if ( ! $this->validMac($payload))
Posted from SensioLabsInsight
Klopt het dat [IngevoerdDoor] en [Omschrijving] niet meekomen?
Groet,
Joep
Since mcrypt is deprecated in php 7.2 the Magister API needs an alternative such as OpenSSL.
Ik vroeg mij af de API alleen werkt voor leerlingen of ook voor docenten.
Voor welke versie van magister is dit ?
Kan ik met deze api bijvoorbeeld alle berichten van "Vandaag" ophalen of alle absenties/te laat van leerlingen opvragen ?
Thanks en keep up the good work ;)
Is it possible to end a session/logout the user? And how?
Hello,
I would like to request the implementation of two new datamodals. Namingly
The courses are required to attach a grade to a specific course since the "Omschrijving" field in the individual grades is null. The url for retreiving the courses would be like :
/api/personen/{id}/aanmeldingen/{enrollment}/vakken
Also the column specific information is required to get the weight of the grades. This information can be retrieved through:
api/personen/{id}/aanmeldingen/{enrollment}/cijfers/extracijferkolominfo/{gradeid}
Currently i wrote the config and the models myself for a quick fix. But would be nice to see this implemented obviously.
Greetings,,
Niels
How do you select a diverent year with grades. Magister\Models\Grade\Grade::all()
just gives me the current year and does not take any arguments.
Hoe verkrijg ik de profielfoto van een magister account? magister.net gebruikt deze link: school.magister.net/api/personen/MagisterID/foto
MagisterID is hier Persoon->Id
in Magister\Models\User::profile();
In the near future, the API will only support Magister version 6.0.24 since almost all schools adopted version 6.0.24, there is hardly demand for version 6.0.23 and will probably not be used by any schools soon. For now, the unstable version (dev-master) supports 6.0.24!
The documentation website seems to be down.
I just get "Apache is functioning normally" or a 404
I'm getting a Uncaught exception 'CurlException'
error when ever I try to use the $magister = new Magister('school', 'username', 'password');
line. (with the correct credentials, of course) It seems to try to resolve locations.login as a domain name. Am I missing something here?
PHP Fatal error: Uncaught exception 'CurlException' with message 'CURLE_COULDNT_RESOLVE_HOST: Could not resolve host: locations.login' in [...]/vendor/shuber/curl/lib/curl.php:169
Stack trace:
#0 [...]/vendor/shuber/curl/lib/curl.php(133): Curl->request('POST', 'locations.login', Array, NULL)
#1 [...]/vendor/stanvk/magister/src/Magister/Magister.php(127): Curl->post('locations.login', Array)
#2 [...]/vendor/stanvk/magister/src/Magister/Magister.php(107): Magister\Magister->invoke('', '')
#3 [...]/vendor/stanvk/magister/src/Magister/Magister.php(51): Magister\Magister->login('', '')
#4 [...]/index.php(8): Magister\Magister->__construct('ozhw', '[leerlingnummer]', '[wachtwoord]')
#5 {main}
thrown in [...]/vendor/shuber/curl/lib/curl.php on line 169
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.