xAPI

3 min. read

xAPI is a standard for recording e-Learning activities in a LRS

Introduction

xAPI, A.K.A The Experience API, AKA Tin Can API, records learner interactions via activity statements.

xAPI Terminologies

  • Activity Statements - User events
  • Activity Stream - A collection of activity statements.
  • Learning Record Provider - Something that sends activity statements.

xAPI Statement Structure

Actor - Person taking the action
Verb - Describes the action taken
Object - Target of the action

JSON Example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
"actor":{
"mbox":"mailto:user@email.com",
"name":"firstName lastName",
"objectType":"Agent"
},
"verb":{
"id":"URL",
"display":{
"en-US":"attended"
}
},
"object":{
"id":"URL",
"objectType":"Activity",
"definition":{
"name":{
"en-US":"Activity name"
},
"description":{
"en-US":"Activity description"
}
}
}
}

xAPI uses IRI (International Resource Identifier)

The Actor Property

Defines who/what did the action

Actor using mbox:

1
2
3
4
5
"actor":{
"mbox":"mailto:user@email.com",
"name":"firstName lastName",
"objectType":"Agent"
},

Actor using account field:

1
2
3
4
5
6
7
8
"actor":{
"account":{
"name":"UserName",
"homePage":"URL"
},
"name":"firstName lastName",
"objectType":"Agent"
},

Actor using mbox_sha1sum field:

1
2
3
4
5
6
"actor":{
"mbox_sha1sum":"614fa9df924816c39141f08f63ff65dc1075257d",
"name":"firstName lastName",
"objectType":"Agent"
},

Actor using openid field:

1
2
3
4
5
6
"actor":{
"openid":"OpenId Provider",
"name":"firstName lastName",
"objectType":"Agent"
},

The Verb Property

1
2
3
4
5
6
7
"verb":{
"id":"URL",
"display":{
"en-US":"attended"
}
},

The Object Property

1
2
3
4
5
6
7
8
9
10
11
12
13
"object":{
"id":"URL",
"objectType":"Activity",
"definition":{
"name":{
"en-US":"Activity name"
},
"description":{
"en-US":"Activity description"
}
}
}

The Result Property (Optional)

1
2
3
4
5
6
7
8
9
"result":{
"completion":true,
"success":true,
"score":{
"raw":50,
"scaled":0.5
}
}

The Context Property (Optional)

Has 9 optional fields:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"context":{
"registration":"UUID",
"instructor":"Agent",
"revision":"",
"platform":"Platform",
"language":"",
"team":"",
"contextActivities":"",
"statementProperties":"",
"extensions":""
}
}

xAPI Extension Property

Object, which can be used to add more informations
Must be a KVP, in the following format:

“IRI”:”Value”

Timestamp Properties

xAPI Providers and Tools

Courses

References

https://watershedlrs.zendesk.com/hc/en-us/articles/360029618392-How-do-I-send-an-xAPI-statement-to-Watershed-using-Postman-

https://docs.moodle.org/dev/Experience_API_(xAPI)