Welcome to Moxie Courses API’s documentation!

HTTP API

Courses endpoint

Endpoint to search and retrieve information about graduate courses. Follows specification of Moxie.

GET /courses/course/(string: id)

Get details of a course by its ID

Example request:

GET /courses/course/daisy-course-8572 HTTP/1.1
Host: api.m.ox.ac.uk
Accept: application/json

Example response as JSON:

HTTP/1.1 200 OK
Content-Type: application/hal+json

{
  "subjects": [],
  "_embedded": {
    "presentations": [
      {
        "attendance_pattern": "Daytime",
        "apply_from": "2012-10-01T00:00:00",
        "apply_until": "2012-11-16T00:00:00",
        "apply_link": "https://weblearn.ox.ac.uk/course-signup/rest/course/3C09CZ0004",
        "_links": {
          "poi": {
            "href": "/places/oxpoints:23232609"
          }
        },
        "location": "oxpoints:23232609",
        "attendance_mode": "Campus",
        "id": "daisy-presentation-19625"
      },
      {
        "attendance_pattern": "Daytime",
        "apply_from": "2012-10-01T00:00:00",
        "apply_until": "2012-11-16T00:00:00",
        "apply_link": "https://weblearn.ox.ac.uk/course-signup/rest/course/3C09CZ0004",
        "_links": {
          "poi": {
            "href": "/places/oxpoints:23232609"
          }
        },
        "location": "oxpoints:23232609",
        "attendance_mode": "Campus",
        "id": "daisy-presentation-15277"
      }
    ]
  },
  "description": "Topics to be [...] ousand Oaks, CA: Sage Publications. \n",
  "title": "Beyond Surveys - Researching the Internet and Internet Data ",
  "_links": {
    "self": {
      "href": "/courses/course/daisy-course-8572"
    }
  },
  "provider": "Oxford Internet Institute",
  "id": "daisy-course-8572"
}

Each presentation MAY have a link to poi, representing the Place of Interest where the course should take place.

Parameters:
  • id (string) – ID of the resource
Status Codes:

Search for courses by title / description or subjects.

Example request:

GET /courses/search?q=python HTTP/1.1
Host: api.m.ox.ac.uk
Accept: application/hal+json

Example response as HAL+JSON:

HTTP/1.1 200 OK
Content-Type: application/hal+json

{
  "query": "python",
  "_embedded": {
    "courses": [
      {
        "_embedded": {
          "presentations": [
            {
              "attendance_pattern": "Daytime",
              "apply_from": "2012-10-01T00:00:00",
              "apply_until": "2012-11-16T00:00:00",
              "apply_link": "https://weblearn.ox.ac.uk/course-signup/rest/course/3C09CZ0004",
              "_links": {
                "poi": {
                  "href": "/places/oxpoints:23232609"
                }
              },
              "location": "oxpoints:23232609",
              "attendance_mode": "Campus",
              "id": "daisy-presentation-19625"
            }
          ]
        },
        "description": "Topics to be cove[...] CA: Sage Publications. \n",
        "title": "Beyond Surveys - Researching the Internet and Internet Data ",
        "subjects": [],
        "_links": {
          "self": {
            "href": "/courses/course/daisy-course-8572"
          }
        },
        "provider": "Oxford Internet Institute",
        "id": "daisy-course-8572"
      }
    ]
  },
  "_links": {
    "hl:first": {
      "href": "/courses/search?q=python&count=35"
    },
    "curie": {
      "href": "http://moxie.readthedocs.org/en/latest/http_api/relations/{rel}.html",
      "name": "hl",
      "templated": true
    },
    "self": {
      "href": "/courses/search?q=python"
    },
    "hl:last": {
      "href": "/courses/search?q=python&count=35"
    }
  }
}

The response contains a list of results, links to go to first, previous, next and last pages depending on current start and count parameters, and the total count of results.

Query Parameters:
 
  • q – full text search query
  • start – first result to display
  • count – number of results to display
Status Codes:
GET /courses/subjects

Get a list of subjects

Example request:

GET /courses/subjects HTTP/1.1
Host: api.m.ox.ac.uk
Accept: application/hal+json

Example response as HAL+JSON:

HTTP/1.1 200 OK
Content-Type: application/hal+json

{
  "_links": {
    "self": {
      "href": "/courses/subjects"
    },
    "courses:subject": [
      {
        "count": 32,
        "href": "/courses/search?q=course_subject%3A%22Career+Development%22",
        "title": "Career Development"
      },
      {
        "count": 24,
        "href": "/courses/search?q=course_subject%3A%22Communication+skills%22",
        "title": "Communication skills"
      },
      {
        "count": 15,
        "href": "/courses/search?q=course_subject%3A%22Teaching+and+Academic+Skills%22",
        "title": "Teaching and Academic Skills"
      },
      {
        "count": 7,
        "href": "/courses/search?q=course_subject%3A%22Technical+skills%22",
        "title": "Technical skills"
      }
    ]
  }
}

You can browse courses by using the relation courses:subjects which provides links to the search resource, to search by subject.

Status Codes:

Providers

WebLearn

WebLearn (Sakai) is a provider available for booking some presentations.

Making a request to the API

All requests should be made requesting JSON (by specifying the HTTP header “Accept: application/json”).

Handling errors from the API

When requesting JSON and in case of an error, some errors will be returned with a description in JSON (see original “documentation”):

  • if the access to the resource is forbidden (HTTP 403)
  • if the resource has not been found (HTTP 404)

For these errors, you will get a JSON response containing:

  • status property: “failed”
  • message property: a user-friendly message

All other exceptions will return an HTML response, you will have to handle the response code.

Booking a course

POST request to /course/cobomo/XXX/booking where XXX is the course ID.

Form parameters:

  • message: mandatory message where the user should explain the reasons to book a course
  • supervisorEmail is only mandatory if`supervisorApproval` is true when you request details on one course.

Returns an object where the status property can be:

  • WAITING: if the component is full
  • PENDING: in any other case

Getting information on one course

Request to /course/cobomo/XXX where XXX is the course ID.

Contains a property supervisorApproval which will determine if asking the user for the email address of its supervisor is mandatory.

The response contains a property supervisorApproval which determines if asking the user for

Getting information on booked course for one user

Status can be WITHDRAWN (meaning that the user has withdrawn his booking, and can book again the presentation).

Withdrawing a booked course

When a student withdraw a course, he cannot book the same course again, he would have to ask the course administrator to re-instate them.

Internal API

Overview

Courses services

Methods to search courses from defined providers.

Indices and tables