I'm trying to use the API of a dutch site that's being used by schools in The Netherlands to keep track of the grades and other data of the students. You can find the documantation here: http://www.magister-api.nl/ (it's in Dutch). I installed Wamp server and Composer, just like the documentation of the API tells. I also have the Curl PHP extension and Mcrypt PHP extension enabled in Wamp, just like the documentation tells. I have the composer.json file in the project root with:
{
"require": {
"stanvk/magister": "~2.0"
}
}
I then executed Composer update.
The only code that I have is:
<?php
require 'vendor/autoload.php';
use Magister\Magister;
use Magister\Models\Grade\Grade;
new Magister($school, $username, $password);
$grades = Grade::all();
foreach ($grades as $grade)
{
echo $grade->CijferStr;
}
?>
It's the exact same code as given as example on the documentation website.
But when I then run it, I get these errors:
I tried a lot to solve the problem, but I can't seem to figure it out. It's the first time I'm using composer and packagist.
The first two errors are unrelated to composer or Wamp - you're simply using two variables that hasn't been defined, $username
and $password
(and possibly $school
). The rest of the errors seems to stem from these having no value (the Magister
object seems to try to request username.magister.net, and without a username .. that field is empty).
Provide the correct username and password and things will probably work as you expect.