An overview of the Schooltraq API

Schooltraq comes with a powerful API, or application-programming interface. As a developer, users can provide you with their Schooltraq data, including courses and assignments, that you can then use in a variety of different ways.

The Schooltraq API is RESTful and uses a modified version of the CRUD terminology. You need to provide a user’s API key with most requests. You can also request a user’s API key if you have their username and password.

These pages are not very relevant or helpful if you’re not a developer. If you’re a user, here’s how you enable API access to your account.

Here’s what you should do first

If you’re beginning to develop an application that uses the Schooltraq API, you should:

  • Reach out to our developers. As a courtesy, please let us know what you’re creating with the Schooltraq API. We might be able to provide free publicity and assistance.
  • Read and follow the API usage policy.
  • Read the API command guide so you can begin developing your application.

Sending requests to the API

You should POST requests via HTTP to https://schooltraq.com/api/. If your application doesn’t support secure connections, you can also use http://schooltraq.com/api/. You should equip yourself to handle redirects, as this URL may redirect you via a 301 or 307 HTTP code.

Requests can be one of four types: getcreateupdate, and delete. You should send the type under the type key. Under each type of request, you should additionally specify the specific request under the request key. For example, if you wanted to get status, you would POST the key-value pairs type: get and request: status to the API endpoint.

All request types and requests should be sent in lowercase. If you need to provide authentication, send the API key under the key key. If you don’t know their API key, you can request get userinfo with their username and password to get their API key.

Receiving requests from the API

All responses from the API are returned formatted as JSON (application/json), with the Access-Control-Allow-Origin: * header to allow to client-side API requests.

All requests, valid or not, will return something. Successful requests will return {response: "success"} with a 200 OK status code, and those met with an error will return {response: "fail"} with a 400 Bad Request status code. You should check the response value, not the status code, to determine whether an action has been successful.