Jump to content

Join the future of EdTech

Moving data from point A to point B should be safe and easy - and with EduCloud it is! You get all the tools you need to take control over your data and see how and where it is shared in real time.

Sign Up
  • Fetching teachers


    Jonas Erlandsson
     Share

    The SS12000 specification don't have a pure teacher or student endpoint. So how can you receive a list of teachers?
    However, the specification do define endpoints for persons working in a school. Each teacher should have an assigned duty, and there is an endpoint for duties.

    Fetching duties
    In this guide we'll use Postman to test our requests. You can download and use our Postman collection to easily get started working with educloud in postman. If you're new to postman you can learn how to import it in the "Importing our Postman Collection" guide.

    Now, to fetch duties we simply make a request to https://api.ist.com/ss12000v2-api/source/SE00100/v2.0/duties.

    fig. 1 - Receive a list of duties

    This returns a list of every duty we have. We can see what school / organisation this duty belongs to, when it started and so on.
    There is also the field dutyRole which defines what kind of work the duty represents.
    In the API documentation you can see that there is a parameter we can use that lets us filter the results to only include those with the duty role of teacher (and since SS12000 is a swedish standard it's called "lärare"):

    fig. 2 - Show available options for dutyRole filters

    So what we need to do then is to add dutyRole as a query param, like so: https://api.ist.com/ss12000v2-api/source/SE00100/v2.0/duties?dutyRole=Lärare - Let's try it and see what kind of result we get back:

    fig 3 - duties filtered on the teacher dutyRole

    If you compare the two you'll see that the first visible object has changed from "Annan Personal" to "Lärare", meaning that our filter was successful.
    What about the personal information about the teacher such as first name or their email addresses?
    In order to get that we need to add one more parameter to our request.

     

    Expanding the result with person

    If we jump back to the documentation one last time we can see that the duties endpoint has another param that we can add to our request, which is the expand key. The expand lets us send in a string or a list of string to expand our request with additional data that the entity we're requesting might hold.

    image.png.17a79abea4d714066148c394688ab212.png

    In the duty case shown below we have the option to expand on "person" which will include a data from the person entity as an embed.

    All data that we get by using the expand key will be available via the _embedded key on the response

    All data that we get by using the expand key will be available via the _embedded key on the response.

    And that's it! Now we've managed to get all the teachers from a specific customer from SS12000.
    If you want to filter the data further, such as fetching teachers from a specific school you can use the "organisation" query param as well.

    If you have any questions regarding this you're most welcome to ask them in the forums.

     Share


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. You can also read up on our Privacy Policy