ASMS API Docs

ASMS API Docs

Getting Started


Introduction

Welcome to the ASMS (Academic Score Management System) API documentation. If you follow the instructions and code examples below you can have your own school setup and start making API requests in minutes!

Let's go into some details about what this API can do.

If you need an API where you need to be able to store and manage data about a school then this is your solution. This API and it's management dashboard was created for a college IOT team project as our project required a list of fake data about students, their performance, and the ability to store card entries of when they enter the school.

Getting Access

In order to get a token to use our API you must first create an account with us. The next step is to click on the "Gimme Token" button to get your token. Remember to save this somewhere save as it cannot be regenerated.

Next you should create a school and populate with data by clicking on the school you created, clicking on the hamburger menu and selecting "Manage".

Example Response

Here is an example of what the API response might look like if you request all the students from a school.

{ "status": 200, "0": [ { "name": "Jessica Smith", "house": "Carden", "card_number": "<uuid>", "points": { "total": 0, "behaviour": { "total": 0, "history": [] }, "grades": { "total": 0, "history": [] }, "attendance": { "total": 0, "history": [] }, "others": { "total": 0, "history": [] } } }, { "name": "Jack Soloff", "house": "Albyn", "card_number": "<uuid>", "points": { "total": 0, "behaviour": { "total": 0, "history": [] }, "grades": { "total": 0, "history": [] }, "attendance": { "total": 0, "history": [] }, "others": { "total": 0, "history": [] } } } ] }
History would include an array of how many points were awarded to a student, the teacher that awarded it and why they were awarded those points.

Endpoints


Schools

This is not really an endpoint but is a base of all your requests, so I felt it was necessary to talk about it in this section. When you create a school you can click to go to see the overview of the school. In the URL it should be schools/{school id} . Copy this school id so that you can use it in a request.

All requests have to be prefixed with schools/{school id} . The response you get will only be the data attached to that school.

Students

Endpoint Description Methods
/students Get all students in a given school. GET
/students/{student uuid} Get a single student. GET
/students/{student uuid}/points Get a single students points and history of said points. GET
/students/{student uuid}/points/total Get a single students total points. GET
/students/{student uuid}/card-entries Get or upload to a single students card entries. By doing: { date : ddmmyyyy hhiiss } . GET POST

Card Entries

Endpoint Description Methods
/card-entries Get all card entries for a given school. GET
student/{student id}/card-entries/date/{date} Get all the card entries for a given date in the format: DDMMYYYHHMMSS . GET
/card-entries/{card entry id} Get a card entry by ID. GET

Points

Endpoint Description Methods
/points Get all point entries for a given school. GET

Custom Reports (Coming Soon!)

If you need to send data to our api to generate a custom report that can be viewed on this website then this is the section just for that! The table below shows the data that you can supply to this endpoint.

Name Description
statistic-blocks [ { "name" : "Students Late on Average", "statistic": "52/122" }, ]
What statistic blocks look like

Displayed at the top of a report. A statistic block would show the statistic then the name you gave the block.

Code Examples


Python

Here is a simple example of making an API request in python to get all the students of a school.

import requests from dotenv import load_dotenv import os load_dotenv() school_id = os.getenv("SCHOOL_ID") token = os.getenv("TOKEN") url = "https://asms.amandawallis.com/api/school/" + school_id headers = {"Authorization": "Bearer " + token} students = (requests.get(url + "/students", headers = headers).json())

In the above code we are getting the token and school id from an environment variables Then we are saving the start of the url to a variable as that part is repetitive. Then we are constructing our header and putting the token as the value of the 'authorization' key. Then we are making a request to get all the students in our school and converting it to JSON.