elisaado / somtoday-api-docs

Documentation for the SOMtoday API
70 stars 15 forks source link

Additional info #3

Closed MakerTim closed 4 years ago

MakerTim commented 5 years ago

https://github.com/elisaado/somtoday-api-docs#grades-get-restv1resultatenhuidigvoorleerlingid

For getting the results of a user i got a example response :) { "items": [{ "$type": "resultaten.RResultaat", "links": [{ "id": 1000000000, "rel": "self", "type": "resultaten.RResultaat", "href": "https://amstelveen-api.somtoday.nl/rest/v1/resultaten/1000000000" }], "permissions": [{ "full": "resultaten.RResultaat:READ:INSTANCE(1000000000)", "type": "resultaten.RResultaat", "operations": ["READ"], "instances": ["INSTANCE(1000000000)"] }], "additionalObjects": {}, "herkansingstype": "Geen", "resultaat": "10.0", "geldendResultaat": "10.0", "datumInvoer": "2018-10-31T17:32:15.218+0100", "teltNietmee": false, "toetsNietGemaakt": false, "leerjaar": 4, "periode": 1, "weging": 3, "isExamendossierResultaat": true, "isVoortgangsdossierResultaat": true, "type": "DeeltoetsKolom", "omschrijving": "Climaxloop", "vak": { "links": [{ "id": 200000000, "rel": "self", "type": "onderwijsinrichting.RVak", "href": "https://amstelveen-api.somtoday.nl/rest/v1/vakken/200000000" }], "permissions": [{ "full": "onderwijsinrichting.RVak:READ:INSTANCE(200000000)", "type": "onderwijsinrichting.RVak", "operations": ["READ"], "instances": ["INSTANCE(200000000)"] }], "additionalObjects": {}, "afkorting": "lo", "naam": "lichamelijke opvoeding" }, "leerling": { "links": [{ "id": 700000000, "rel": "self", "type": "leerling.RLeerlingPrimer", "href": "https://amstelveen-api.somtoday.nl/rest/v1/leerlingen/700000000" }], "permissions": [{ "full": "leerling.RLeerlingPrimer:READ:INSTANCE(700000000)", "type": "leerling.RLeerlingPrimer", "operations": ["READ"], "instances": ["INSTANCE(700000000)"] }], "additionalObjects": {}, "leerlingnummer": 100000, "roepnaam": "MyName", "achternaam": "StillMyName" }, "volgnummer": 123 }] }

Also: the [user id] is from a get reqest in /rest/v1/leerlingen, thats not clear at all where to get the id from would be great to read that as a note as well

ps. tnx for the documentation it helped me out quiet a lot!

elisaado commented 5 years ago

Hi, I will add the information once I have some free time, thank you for reporting this issue :)

elisaado commented 5 years ago

Hey @MakerTim

Also: the [user id] is from a get reqest in /rest/v1/leerlingen, thats not clear at all where to get the id from would be great to read that as a note as well

First you can use the GET /rest/v1/leerlingen (with the only parameter being your access_token), it will return all the leerlingen connected to your account (so, if you are a leerling, it will return you).

If you are a school admin and you want to get info about a leerling you have access to, and you know their ID, you can use GET /rest/v1/leerlingen/[id] with ID being the user_id of the leerling, you can find your own user ID from the previous request (the request without the [id] part).