Guardian API#

An API for information about students a given parent/guardian is responsible for.

Warning

This is a proof of concept implementation. It may be changed or discontinued at short notice.

All calls are to be made using ‘POST’.

Examples#

The example looks up the students of a given guardian.

It requires that the guardian is logged in using ID-porten and that $TOKEN contains the access token you received during authentication. You must also have the gk_guardianapi scope in order to be able to access this API.

Students for a guardian#

Look up students for a given guardian.

curl -sS -H "Authorization: Bearer $TOKEN"  -d guardian=21079416549 -d realm=testusers.feide.no \
   https://guardianapi.dataporten-api.no/guardian_students

[{"eduPersonPrincipalName": "thea_elevg@testusers.feide.no",
  "email": "thea.nilsen@test.feide.no",
  "userid": "9eb60ee0-8d10-410d-93a8-04190d51ba89",
  "givenName": "Thea",
  "norEduPersonLegalName": "Thea Nilsen"}]

Returns an application/json array of one object for each of the students in a Feide realm the guardian is parent/guardian of. The possible attributes of the students that can be returned - if they are available in the system - are:

  • eduPersonPrincipalName

  • email

  • givenName

  • mobile

  • norEduPersonLegalName

  • norEduPersonLIN

  • norEduPersonNIN

  • userid

If there is more than one student for a guardian, there will be one object like this for each student.

If the organization has activated the service for only some of its organization units (schools), only students who belong to at least one of those organization units are returned. Other students, including students who are not registered under any organization unit, are left out of the response. This means that the response can be an empty list even if the guardian has students in the realm.

In this proof of concept implementation, only the logged in guardian’s own students may be looked up. It is possible that we may later want to allow teachers or administrators to perform the call. This is the reason that there is an explicit guardian parameter.

Errors#

The API returns 400 Bad Request when realm or guardian is missing or malformed.

It returns 401 Unauthorized when the access token is missing, invalid or expired.

It returns 403 Forbidden when the requirements below are not met.

Requirements for accessing the API#

  • The access token must have the gk_guardianapi scope.

  • The access token must be associated with a logged in user.

  • The user must be logged in using ID-porten.

  • The user’s NIN must match the provided guardian.

  • The service must have been activated for the entire organization associated with the provided realm or for at least one of its organization units. For testusers.feide.no, Feide test users must be enabled for the client.