...
Go to the xAPI HTTP interface documentation to see the rest of the xAPI routes.
Route | Description |
---|---|
Stores a single statement. | |
Stores a single statement or multiple statements. | |
Retrieves statements. |
PUT /statements
This route allows you to create a single statement with a statement identifier in the URL parameters and the statement itself in the JSON body. A request to this API would look something like the request below.
...
For more information, view the PUT /statements route in the xAPI specification.
POST /statements
This route allows you to create a multiple statements with or without statement identifiers. A request to this API would look something like the request below.
...
For more information, view the POST /statements route in the xAPI specification.
GET /statements
This route allows you to retrieve a single statement or multiple statements. If the statementId
or voidedStatementId
URL parameters are set, it will retrieve a single statement with the given identifier, otherwise it will retrieve many statements. For more information, view the GET /statements route in the xAPI specification.
<iframe src="https://player.vimeo.com/video/168960744" width="80%" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen style="padding-left: 15%;"></iframe>
Single Statement
In addition to the statementId
and voidedStatementId
URL parameters (one of which must be set to retrieve a single statement), there are two additional optional parameters in the form of format
and attachments
. The format
parameter defaults to "exact" if it's not set, the other options are "ids" (only includes minimal information) and "canonical" (only includes one language per language map). The attachments
parameter is a boolean that determines if the statement's attachments are returned with the statement.
...
Code Block |
---|
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 X-Experience-API-Version: 1.0.3 X-Experience-API-Consistent-Through: 2017-08-31T15:16:29.709Z { "id": "dfb7218c-0fc9-4dfc-9524-d497097de027", "actor": { "objectType": "Agent", "mbox": "mailto:test@example.org" }, "verb": { "id": "http://www.example.org/verb" }, "object": { "objectType": "Activity", "id": "http://www.example.org/activity" }, "version": "1.0.3", "authority": { "objectType": "Agent", "mbox": "mailto:authority@example.org" }, "timestamp": "2017-09-05T12:45:31+00:00", "stored": "2017-09-05T12:45:31+00:00" } |
Many Statements
When retrieving multiple statements there are a number of optional URL parameters listed below that can be used to filter statements. All of the URL parameters should be URL encoded (after JSON encoding if JSON encoding is required).
...