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.
This route allows you to create a single state document if it doesn't exist or overwrite an existing state document if it does exist. The route has 3 required URL parameters, an activityId (an IRI representing the activity), an agent (a JSON encoded object representing the agent the state belongs to), and a stateId (a string representing an identifier for the state). There is also an optional URL parameter for the registration. A request to this route would look something like the request below.
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.
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.
The response to the request above would be something similar to the response below, where the JSON encoded response body contains an array of state identifiers that match the URL parameters.