User Tools

Site Tools


api1:data:event

Once all the management layers and knowledge’s structure are declared, you can start registering all your student’s data and retrieve their statistics on our API. Hence, you can declare Event objects and manage them. For instance, if you need to store results, you can delare an Event object with a EventResult type.

 Event schema

Object resources

Property Type Description
type Text The type of this Event object. “EventResult”, “EventRead”, etc.
student_id Integer Student identifier
knowledge_node_student_id Integer The knowledge cell/student pair this result belongs to
knowledge_node_id Integer The knowledge node related to event identifier
generated_at DateTime Time at which the event has been done
payload Text The payload of this event. If you deal with an Event of a “EventResult” type you can send either “0” or “100”
standard String standard used to declare the payload
instance_id Integer The instance this event belongs to
expected_at Timestamp The date the event as expected to happen
created_at Timestamp The creation date of the object
updated_at Timestamp The last update date of the object

Create (POST)

Method POST
URL /events
Parameters (*Required parameters)
Property Type Description
knowledge_node_student_id Integer The knowledge cell/student pair this result belongs to
type Text The type of this Event object. “EventResult”, “EventRead”, etc.
payload Text The payload of this event. If you deal with an Event of a “EventResult” type you can send either “0” or “100”
Send the request (JSON input example)
{
	knowledge_node_student_id: 1,
	type: “EventResult”,
	payload: “100”
}
Get the response (JSON output example)
{
	id: 1,
	knowledge_node_student_id: 1,
	type: “EventResult”,
	payload: “100”,
	instance_id: 1,
	created_at: 2014-09-17 09:21:03,
	updated_at: 2014-09-17 09:21:03
}

Fetch (GET)

Method GET
URL /events/{event_id}

If no event_id is provided it will fetch all the events for your instance.

Get the response (JSON output example)
{
	id : 1,
	knowledge_node_student_id : 1,
	type: “EventResult”,
	payload: “100”,
	instance_id : 1,
	created_at : 2014-09-17 09:21:03,
	updated_at : 2014-09-17 09:21:03
}
[{
	id : 1,
	knowledge_node_student_id : 1,
	type: “EventResult”,
	payload: “100”,
	instance_id : 1,
	created_at : 2014-09-17 09:21:03,
	updated_at : 2014-09-17 09:21:03
},
{
	id : 2,
	knowledge_node_student_id : 1,
	type: “EventResult”,
	payload: “0”,
	instance_id : 1,
	created_at : 2014-09-17 09:21:03,
	updated_at : 2014-09-17 09:21:03
}]

Fetch events by Knowledge Node Student

Instead of using event id to retrieve related data, you can fetch all events for a given Knowledge Node Student.

Method GET
URL /knowledge_node_students/{knowledge_node_student_id}/events
api1/data/event.txt · Last modified: 2017/10/17 15:14 by maries