Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The table below describes the routes that the HTTP interface provides, all of the URLs are relative to http://www.example.org/data/xAPI where http://www.example.org is the URL of your Learning Locker instance. To access this interface, you must additionally supply your Basic Auth details with each request in the Authorization header. Your Basic Auth details can be found under Settings > Clients. Go to the xAPI HTTP interface documentation to see the rest of the xAPI routes.

Route

Description

PUT /activities/state

Creates or overwrites a state document.

POST /activities/state

Creates or merges a state document.

GET /activities/state

Retrieves a single state document or multiple state identifiers.

DELETE /activities/state

Deletes a single state document or multiple state documents.

...

For more information, view the PUT /activities/state route in the xAPI specification.

POST /activities/state

This route allows you to create a single state document if it doesn't exist or merge an existing state document if it does exist. The route allows the same URL parameters as the PUT /activities/state route. The state document is merged when the state document exists, the existing state document is a JSON encoded object, and the posted state document is a JSON encoded object. When the two JSON encoded documents are merged, only the top-level properties are merged. The example requests below demonstrate merging state documents. For more information, view the POST /activities/state route in the xAPI specification.

POST Initial State

To POST an initial state, the request should be something like the request below.

...

This route allows you to retrieve a single state document or multiple state identifiers. If the stateId URL parameter is set, it will retrieve a single state document with the state identifier, otherwise it will retrieve many state identifiers. For more information, view the GET /activities/state route in the xAPI specification.

Retrieve Single State Document

The route allows the same URL parameters as the PUT /activities/state route. A request to this route should be similar to the request below.

...

The route allows the same URL parameters as the PUT /activities/state route except for the stateId parameter and with the addition of the optional since parameter. The since URL parameter is an ISO timestamp that ensures only state identifiers stored since the timestamp (exclusive) are returned. A request to this route should be similar to the request below.

...

This route allows you to delete a single state document or multiple state documents. If the stateId URL parameter is set, it will delete a single state document with the state identifier, otherwise it will delete many state documents. For more information, view the DELETE /activities/state route in the xAPI specification.

Delete Single State Document

The route allows the same URL parameters as the PUT /activities/state route. A request to this route should be similar to the request below.

...

The route allows the same URL parameters as the PUT /activities/state route except for the stateId parameter. A request to this route should be similar to the request below.

...