Follow

About the ScholarPack API

About

The ScholarPack REST API allows software suppliers to gain read and write access to data stored in ScholarPack schools for use in their own application.

The following link contains our Open API documentation https://sandbox.scholarpack.co.uk/api/v1/ which outlines the data that can be accessed through our API. This includes for example basic student details, daily register marks, and staff details.

URI Structure

The structure of the URI to access resources is as follows:

https://<subdomain>.scholarpack.co.uk/api/<version>/<resource-name>/

<subdomain> can be either 'sandbox' or 'services'. Sandbox is the testing environment and services is the production environment.

An example URI looks like the following:

https://sandbox.scholarpack.co.uk/api/v1/students/

The current version of the ScholarPack API is 'v1'. 

In order to access a resource you must send a valid access token as Bearer in the authorisation header.

Authorisation

ScholarPack uses the OAuth 2.0 authorisation code flow, or "three-legged OAuth". This protocol is widely used for enabling third-party applications to gain access to a limited scope of a resource owner's data over HTTP. Please see the authorisation section for a detailed overview.

Pagination and Filters

Pagination

To improve performance the ScholarPack REST API uses pagination. This means in a response with a large set of results the data will be spread across multiple pages to make it easier to handle. You can control the pagination by passing parameters in the request. For example by default the following request would result in the following:

GET https://sandbox.scholarpack.co.uk/api/v1/students/
{
    "has_next": true,
    "has_prev": false,
    "next_num": 2,
    "page": 1,
    "pages": 8,
    "per_page": 50,
    "prev_num": null,
    "next_uri": "https://sandbox.scholarpack.co.uk/api/v1/students/?page=2",
    "prev_uri": null,
    "data": [
        ...
    ]

You can for example limit the number of results per page:

GET https://sandbox.scholarpack.co.uk/api/v1/students/?per_page=10
{
    "has_next": true,
    "has_prev": false,
    "next_num": 2,
    "page": 1,
    "pages": 36,
    "per_page": 10,
    "prev_num": null,
    "next_uri": "https://sandbox.scholarpack.co.uk/api/v1/students/?page=2&per_page=10",
    "prev_uri": null,
    "data": [
        ...
    ]

Filter on Fields

You can filter on any of the returned fields on all endpoints. The request format is as follows:

register/?filter=[{"field_name": "date", "operator": "=","value": "2018-01-01"}]

To filter on multiple fields, each field object can be separated by a comma:

register/?filter=[{"field_name": "date", "operator": ">","value": "2018-01-01"},{"field_name": "date", "operator": "<","value": "2018-07-23"}]

Permissions

In order for a school to authorise a client the user must have the admin role in ScholarPack.

Scopes

A list of scopes can be found here.

Postman

Postman is a widely used tool for testing APIs, you can download this here: https://www.getpostman.com/.

To help you get started with the ScholarPack API we have created a Postman collection and environment. Once you have imported these into Postman and added your credentials into the environment, you will be able to test the OAuth2.0 flow and make requests.

Download

API Postman Collection.zip

Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request
Powered by Zendesk