0% found this document useful (0 votes)
30 views

Learning_Experience_API__xAPI_

The document provides a technical brief on the Learning Experience API (xAPI) by Oracle, detailing its purpose to record learner progress and completions through xAPI statements. It includes information on API usage, structure of xAPI statements, and guidelines for implementation, emphasizing the need for proper authentication and setup. Additionally, it contains disclaimers regarding proprietary information and the non-binding nature of the document's content for future functionalities.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

Learning_Experience_API__xAPI_

The document provides a technical brief on the Learning Experience API (xAPI) by Oracle, detailing its purpose to record learner progress and completions through xAPI statements. It includes information on API usage, structure of xAPI statements, and guidelines for implementation, emphasizing the need for proper authentication and setup. Additionally, it contains disclaimers regarding proprietary information and the non-binding nature of the document's content for future functionalities.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Business / Technical Brief

Learning Experience API (xAPI)

Oracle Learning

Oct 2024, Version 2.0


Copyright © 2024, Oracle and/or its affiliates
Public

1 Business / Technical Brief / Learning Experience API (xAPI) / Version 2.0


Copyright © 2024, Oracle and/or its affiliates / Public
Purpose statement
This document explains how you can use Experience API aka xAPI statements to
record learner progress and completions. xAPI is a specification for learning
technology that makes it possible to collect data about the wide range of
experiences a person has (online and offline).

Disclaimer
This document in any form, software or printed matter, contains proprietary
information that is the exclusive property of Oracle. Your access to and use of
this confidential material is subject to the terms and conditions of your Oracle
software license and service agreement, which has been executed and with
which you agree to comply. This document and information contained herein
may not be disclosed, copied, reproduced or distributed to anyone outside
Oracle without prior written consent of Oracle. This document is not part of your
license agreement nor can it be incorporated into any contractual agreement
with Oracle or its subsidiaries or affiliates.

This document is for informational purposes only and is intended solely to assist
you in planning for the implementation and upgrade of the product features
described. It is not a commitment to deliver any material, code, or functionality,
and should not be relied upon in making purchasing decisions. The
development, release, and timing of any features or functionality described in
this document remains at the sole discretion of Oracle. Due to the nature of the
product architecture, it may not be possible to safely include all features
described in this document without risking significant destabilization of the code.

The revenue recognition disclaimer on this page is required for any business
brief that addresses future functionality or for products that are not yet generally
available (GA). If you are unsure whether your statement of direction needs the
disclaimer, read the revenue recognition policy. If you have further questions
about your content and the disclaimer requirements, e-mail
[email protected]. If you do not need the disclaimer, you may delete it
and the page that it appears. First, display hidden characters by clicking on the
Paragraph icon on the Home toolbar. It is a small, square icon that appears to the
left of the Quick Style Gallery. Then, highlight all the text on this page and press
the Delete key. Notice that there is a section break displayed as a double-dotted
line at the bottom of this page. Continue to press Delete until the page
disappears and your cursor is on the Table of Contents page. Be sure not to
remove the section break, or the formatting of the title page will be incorrect.
Delete this note before publishing.

The testing disclaimer in the TM block on the last page (highlighted in yellow) is
provided by the FCC for hardware products. It must appear in the TM block.

2 Business / Technical Brief / Learning Experience API (xAPI) / Version 2.0


Copyright © 2024, Oracle and/or its affiliates / Public
Table of contents

Purpose statement 2
Disclaimer 2
Document Control 5
Introduction 6
Key points 6
API Details 6
User Setup 6
Sample POST Request 6
Anatomy of an xAPI statement 9
1.Actors 11
2.Verbs 13
3. Object 14
4. Result 16
5. Version 17
6. Timestamp 17
7. Id 17
Validations 17
Sample Payloads 20
Sample 1- verbs that mark a learner in progress 20
Sample 2 - statement to mark learner completed 20
Sample 3- statement to mark learner exempted 21
Manual Processing of statements 22
FAQ’s 23
Helpful Resources 23

3 Business / Technical Brief / Learning Experience API (xAPI) / Version 2.0


Copyright © 2024, Oracle and/or its affiliates / Public
List of Tables

Table 1. API Details 6


Table 2. Sample post request 8
Table 3. Anatomy of an xAPI statement 11
Table 4. Representation of actor in an xAPI statement 13
Table 5. Representation of verb in an xAPI statement 14
Table 6. Supported verbs 14
Table 7. Representation of object in an xAPI statement 15
Table 8. Object types 16
Table 9. Supported extension in result 16
Table 10. Elements of Timestamp 17
Table 11. Oracle Learning specific validations 18
Table 12. xAPI standard validations 20
Table 13. Sample payload #1 20
Table 14. Sample payload #2 21
Table 15. Sample payload #3 22

4 Business / Technical Brief / Learning Experience API (xAPI) / Version 2.0


Copyright © 2024, Oracle and/or its affiliates / Public
Document Control
Change Record
Date Version Changes Reference
22-Aug-24 1.0 Initial Version
23-Oct-24 2.0 Added release 25A use cases.

5 Business / Technical Brief / Learning Experience API (xAPI) / Version 2.0


Copyright © 2024, Oracle and/or its affiliates / Public
Introduction
You can make use of /statements API to update learner enrolments by using xAPI statements. This API can capture
data in a consistent format about a person's activities from multiple disparate systems. At a high level an xAPI
statement should contains following information:

• Learner details who had a learning experience


• What was done such as started or completed.
• Learning object that learner experienced
• Time of the learner experience

When you POST a statement with all above details in an acceptable format described further in this document, Oracle
will immediately process the statement learner enrolment updates will be reflected near real time.

Key points

1. You need to enable Digital Learning feature to use xAPI.


2. You can only record learner experiences for learning which is URL-based (weblink)
3. You should set the completion rule to “Content Handles Completion” if you wish learner completions to be
driven by xAPI statements.

API Details
DETAIL VALUE

Endpoint URL https://{{hostname}}/hcmRestApi/redwood/xAPI/statements

Supported POST, GET


Operations

Required X-Experience-API-Version: 1.0.0


Headers

Authentication Basic Authentication, JSON Web Token (JWT)

Table 1. API Details

User Setup
The user who is authenticating the API should have the functional security privilege
WLF_REST_SERVICE_ACCESS_LEARNING_XAPI_PRIV. Users with this privilege will be able to POST statements for
any learner so we recommend to exercise caution while assigning this privilege.

Starting release 25A, you can enable learners to POST their own progress or completions for URL-based learning by
explicitly assign the privilege WLF_POST_PROGRESSION_FOR_SELF_USING_XAPI.

Sample POST Request


Below statement posts an experience where learner with username "meg.fitzimmons", "completed" a course named
"Leading in the Age of Generative AI" with a unique identifier "OID_COURSE_00402123" on "2024-08-21"

Note - For real time processing, include only a single statement in each request. Request with multiple statements will
not be processed automatically and will need to be handled manually by scheduling an ESS job.

6 Business / Technical Brief / Learning Experience API (xAPI) / Version 2.0


Copyright © 2024, Oracle and/or its affiliates / Public
REQUEST
OPERATION REQUEST PAYLOAD RESPONSE
URL

POST https://f { 200 OK


a-eodv- "actor": {
test- "account": { [
saasfapro "name": "meg.fitzimmons", "ec572ce3-9f34-429f-80c1-
d1.fa.ocs. "homePage": "https://oraclesandbox.oracle.com" ef682037c7f2” – This is the
oracleclo }, unique ID generated for this
ud.com/h "objectType": "Agent" statement.
cmRestAp }, ]
i/redwoo "verb": {
d/xAPI/st "display": {
atements "en": "completed"
},
"id": "https:\/\/fanyv88.com:443\/http\/adlnet.gov\/expapi\/verbs\/completed"
},
"object": {
"definition": {
"name": {
"en": "Leading in the Age of Generative AI"
},
"type": "https:\/\/fanyv88.com:443\/https\/w3id.org\/xapi\/video\/activity-
type\/course"
},
"id":
"https:\/\/fanyv88.com:443\/https\/xapi.provider.com\/xapi\/course\/OID_COU
RSE_00402123",
"objectType": "Activity"
},
"id":"{{$randomUUID}}",
"version": "1.0.0",
"timestamp": "2024-08-21T06:09:57.290Z"
}

GET https://fa N/A 200 OK


-eodv-
test- {
saasfapro "actor": {
d1.fa.ocs. "account": {
oracleclou "name": "meg.fitzimmons",
d.com/hc "homePage":
mRestApi "https://oraclesandbox.oracl
/redwood e.com"
/xAPI/stat },
ements?st "objectType": "Agent"
atementId },
=ec572ce "stored": "2024-08-
3-9f34- 21T11:15:00.547Z",
429f- "verb": {
80c1- "display": {
ef682037 "en": "completed"
c7f2 },
"id":
"http://adlnet.gov/expapi/v
erbs/completed"
},
"id": "ec572ce3-9f34-429f-

7 Business / Technical Brief / Learning Experience API (xAPI) / Version 2.0


Copyright © 2024, Oracle and/or its affiliates / Public
REQUEST
OPERATION REQUEST PAYLOAD RESPONSE
URL

80c1-ef682037c7f2",
"version": "1.0.0",
"object": {
"definition": {
"name": {
"en": "Leading in the Age of
Generative AI"
},
"type":
"https://w3id.org/xapi/video
/activity-type/course"
},
"id":
"https://xapi.provider.com/x
api/course/OID_COURSE_00
402123",
"objectType": "Activity"
},
"timestamp": "2024-03-
21T06:09:57.290Z"
}

Table 2. Sample post request

8 Business / Technical Brief / Learning Experience API (xAPI) / Version 2.0


Copyright © 2024, Oracle and/or its affiliates / Public
Anatomy of an xAPI statement
{

"actor": {1
"account": {
"name":"meg.fitzimmons",
"homePage": "https://oraclesandbox.oracle.com"
},
"objectType": "Agent"
},

"verb": {2
"display": {
"en": "completed"
},
"id": "http://adlnet.gov/expapi/verbs/completed"
},

"object":{3

"definition":{
"name":{
"en":"The art of staying focused"
},
"type":"http://adlnet.gov/expapi/activities/course"
},
"id":"https://xapi.CompanyX.com/xapi/course/562c1f97-fea5-11e6-8638-0242c0a80b06",
"objectType":"Activity"
},

"result":{4

"duration":"PT2M57S",

"score":{

"min":0,

"max":100,

"raw":89
}
},

"version":"1.0.0",5
"timestamp":"2023-02-21T12:58:36.561Z",6

"id":"{{$randomUUID}}"7

9 Business / Technical Brief / Learning Experience API (xAPI) / Version 2.0


Copyright © 2024, Oracle and/or its affiliates / Public
XAPI
IDENTIFIER SAMPLE DEFINITION REQUIRED
ELEMENT

1 actor "actor": { Represents Yes


the learner in
"account": { Oracle
Learning
"name":"meg.fitzimmons", whose
statement is
"homePage": "https://oraclesandbox.oracle.com" being
processed.
},

"objectType": "Agent"

2 verb "verb": { Represents Yes


"display": { the user
"en": "completed" action. The
}, enrollment
"id": "http://adlnet.gov/expapi/verbs/completed" status of the
}, learner after
statement
processing will
depend on the
value of the
verb.

3 object "object":{ Represents Yes


the content for
"definition":{ which the
"name":{ statement is
"en":"The art of staying focused" being
}, processed.
"type":"http://adlnet.gov/expapi/activities/course"
},
"id":"https://xapi.CompanyX.com/xapi/course/562c1f97-
fea5-11e6-8638-0242c0a80b06",
"objectType":"Activity"
},

4 result "result":{4 Represents No


additional
"duration":"PT2M57S", information
about learner
"score":{ experience.
This is usually
"min":0, a measured
outcome such
"max":100, as time spent,
consumed
"raw":89 length or
} score
}, achieved.

10 Business / Technical Brief / Learning Experience API (xAPI) / Version 2.0


Copyright © 2024, Oracle and/or its affiliates / Public
XAPI
IDENTIFIER SAMPLE DEFINITION REQUIRED
ELEMENT

5 version "version":"1.0.0" Represents Yes


version of the
statement.

6 timestamp "timestamp":"2023-02-21T12:58:36.561Z" Represents Yes


the time when
the user action
was
performed.

7 id "id":"{{$randomUUID}}" UUID No

Table 3. Anatomy of an xAPI statement

1.Actors
Actor element is used to identify the learner in Oracle Learning whose statement is being processed. Actor
information can be passed using either account or mbox formats. We recommend setting up the actor to utilize the
Account format which utilizes the username to identify the learner.

We discourage use of mbox format as multiple people might have the same email address (mbox account) and email
addresses change more frequently than account name. If there are duplicate email addresses, we cannot guarantee
that statement will be processed for the correct person.

How an actor is represented in an xAPI statement

Account format (Recommended)

"actor":{

"account":{

"name":"ravi.chouhan",

"homePage":"https://oraclesandbox.provider.com"

},

"objectType":"Agent"

Mailbox (mbox) format

"actor": {

"objectType": "Agent",

"mbox": "mailto:[email protected]",

"name": "Ravi"

11 Business / Technical Brief / Learning Experience API (xAPI) / Version 2.0


Copyright © 2024, Oracle and/or its affiliates / Public
}

FORMAT SAMPLE STRUCTURE ELEMENTS DESCRIPTION REQUIRED USAGE

account "actor":{ name Username of the Yes Used to


"account":{ learner within uniquely
"name":"ravi.chouhan", the provider identify the
system and learner
"homePage":"https://oraclesandbox.provider.com" Oracle Learning
}, typically
"objectType":"Agent" managed via
} SSO. This must
match the
username in
Oracle HCM
cloud. If not,
learner cannot
be identified and
xAPI statements
would not be
processed.

homePage host name of the Yes Not used in


learning statement
environment. processing
This must be in but
URL format. This required to
is not displayed maintain
anywhere in the the xAPI
application but is standards.
stored as part of
the xAPI
statement.

objectType Fixed value - Yes Not used


Agent in
statement
processing
but
required to
maintain
the xAPI
standards.

mbox "actor": { name Display Name No Not used in


"name": "Meg.Fitzimmons", statement
"mbox": "mailto: processing
mailto:[email protected]”, but
"objectType": "Agent" required to
}, maintain
the xAPI
standards.

12 Business / Technical Brief / Learning Experience API (xAPI) / Version 2.0


Copyright © 2024, Oracle and/or its affiliates / Public
FORMAT SAMPLE STRUCTURE ELEMENTS DESCRIPTION REQUIRED USAGE

mbox Email ID to Yes Used to


uniquely identify uniquely
learner. Email identify the
address needs to learner
match primary
work email of
the learner in
Oracle HCM
cloud. This
value needs to
be unique within
HCM, else we
cannot
guarantee that
statement will be
processed for
the correct
person or
processed at all.

objectType Fixed value - Yes Not used


Agent in
statement
processing
but
required to
maintain
the xAPI
standards.

Table 4. Representation of actor in an xAPI statement

2.Verbs
Verbs indicate the user action performed. Based on the user action, Oracle Learning will update the Enrollment
status/sub status. There are a number of standard xAPI verbs, but Oracle supports a subset of verbs listed below.

How verb is represented in an xAPI statement

"verb": {

"display": {

"en": "completed"

},

"id": "http://adlnet.gov/expapi/verbs/completed"

},

13 Business / Technical Brief / Learning Experience API (xAPI) / Version 2.0


Copyright © 2024, Oracle and/or its affiliates / Public
ELEMENTS DESCRIPTION REQUIRED USAGE

display Friendly, translatable display name of the verb. Yes N/A

id IRI of the xAPI verb. Yes Used to determine what


should be the status of
Note: Id needs to be in form of an IRI as per xAPI learner's enrolment after
specifications. For processing purpose, the term after statement processing- In
the last “/” of the IRI will be picked. For example, if Progress, Completed,
verb.id is specified as Exempted etc.
http://adlnet.gov/expapi/verbs/completed , last part
of the IRI will be extracted and verb will be considered
as “completed”

Table 5. Representation of verb in an xAPI statement

Oracle Learning supported Verbs

Below are acceptable values for the verb Id. If you send a value outside this list, request may succeed but statement
will not be processed.

ORACLE LEARNING MAPPING (STATUS-


# XAPI VERB IRI
SUB STATUS)

1 initialized http://adlnet.gov/expapi/verbs/initialized Marks learner enrolment Active - In Progress

2 experienced http://adlnet.gov/expapi/verbs/experienced Marks learner enrolment Active - In Progress

3 completed http://adlnet.gov/expapi/verbs/completed Marks learner enrolment Complete - Complete

4 Satisfied https://w3id.org/xapi/adl/verbs/satisfied Marks learner enrolment Complete - Complete

5 Scored https://w3id.org/xapi/dod-isd/verbs/scored Marks learner enrolment Complete - Complete

6 unSatisfied http://activitystrea.ms/schema/1.0/unsatisfy Marks learner enrolment Complete – Not Passed

7 Waived https://w3id.org/xapi/adl/verbs/waived Marks learner enrolment Exempted

Table 6. Supported verbs

3. Object
Object uniquely identifies a content in Oracle learning. The Id of the object must map to the learning item number of a
Weblink type of Self-Paced learning (also called Digital Learning) in Oracle Learning.

How object is represented in an xAPI statement

"object":{3

14 Business / Technical Brief / Learning Experience API (xAPI) / Version 2.0


Copyright © 2024, Oracle and/or its affiliates / Public
"definition":{

"name":{

"en":"The art of staying focused"

},

"type":"http://adlnet.gov/expapi/activities/course"

},

"id":"https://xapi.CompanyX.com/xapi/course/562c1f97-fea5-11e6-8638-0242c0a80b06",

"objectType":"Activity"

ELEMENTS DESCRIPTION REQUIRED USAGE

id Unique identifier of the learning item in Oracle Yes Used to identify the learning
Learning Cloud. item in Oracle Learning which
learner has experienced.
Note: Id needs to be in form of an IRI as per xAPI Further, used to fetch or create
specifications. For processing purpose, the term learner's enrollment on this
after the last “/” of the IRI will be picked. For learning item.
example, if object.id is specified as
“https://xapi.provider.com/xapi/video/5bad8340-
ddd5-11e7-90ec” , last part of the IRI will be
extracted and id will be considered as “5bad8340-
ddd5-11e7-90ec”. This must match with the
learning Item number of a valid URL based self-
paced learning.

objectType Always Activity Yes Not used in statement


processing but required to
maintain the xAPI standards.

name Display Name of the object. Yes Not used in statement


processing but required to
maintain the xAPI standards.

type IRI of the object type indicating the type such as Yes Not used in statement
Course, Book, Video etc. processing but required to
maintain the xAPI standards.

Table 7. Representation of object in an xAPI statement

15 Business / Technical Brief / Learning Experience API (xAPI) / Version 2.0


Copyright © 2024, Oracle and/or its affiliates / Public
Some of the object types with IRI are listed below for reference.

# TYPE IRI

1 Article http://activitystrea.ms/schema/1.0/article

2 Assessment http://adlnet.gov/expapi/activities/assessment

3 Book http://id.tincanapi.com/activitytype/book

4 Document http://id.tincanapi.com/activitytype/document

5 Observation https://xapi.oracle.com/xapi/activity-type/observationchecklist
Checklist

5 Online http://adlnet.gov/expapi/activities/course
Course

6 Podcast https://xapi.oracle.com/xapi/activity-type/podcast

7 Video https://w3id.org/xapi/video/activity-type/video

8 AudioBook http://activitystrea.ms/schema/1.0/audio

Table 8. Object types

4. Result
The result element represents a measured learning outcome. Some of the values in results element are processed
and stored in Oracle Learning. They are listed below. Values outside this list will be accepted in the statement but will
not be stored or displayed in Oracle Learning.

SUPPORTED
DEFINITION REQUIRED USAGE
EXTENSIONS

duration Duration of the time No Stored as "actual effort" on the activity attempt and will
learner spent on the be shown on learner transcript as actual effort.
experience.
Note- Duration must be expressed in ISO 8601
duration format with the highest permissible unit as
Days. We will not process duration if expressed in
Month, Week or years.

score Raw score achieved by No Stored as "actual score" on the activity attempt and will
the learner. be shown on learner transcript as score.

• raw
Note - When passed along with a min score and a max
score, raw score must be a number greater than or
equal to 0. It should be smaller than max score and
greater than min score.

Table 9. Supported extension in result

16 Business / Technical Brief / Learning Experience API (xAPI) / Version 2.0


Copyright © 2024, Oracle and/or its affiliates / Public
5. Version
"version":"1.0.0"

Always use 1.0.0 as version. This is a required element in the xAPI statement.

6. Timestamp
"timestamp":"2023-02-21T12:58:36.561Z"

ELEMENTS DESCRIPTION REQUIRED USAGE

timestamp Represents the Yes For verbs that indicate start of a content, timestamp is stored
time when the as activity attempt start date.
user action was
performed. For verbs that indicate completion, timestamp is stored as
activity attempt completion date.

Note - should be a timestamp string in an ISO 8601 format as


shown in the example. Always convert the time to UTC time
zone.

Table 10. Elements of Timestamp

7. Id
UUID of the statement. Id will be auto generated if not passed in the statement.

"id":"{{$randomUUID}}"

Validations
Oracle Learning has implemented xAPI validations, on functionality Oracle Learning supports, based on xAPI
standard validation requirements and also Oracle Learning specific validations since we do not support all the
functionality within xAPI. An example of an Oracle Learning specific validation is that Oracle Learning will fail if a valid
xAPI verb is passed that Oracle Learning does not use/support. Oracle Learning is not using all of the xAPI
functionality so Oracle Learning is only using the xAPI validations that are relevant to the functionality that has been
implemented.

Providers can utilize the xAPI standards validation spec and also utilize the conformance test suite to validate xAPI
statements.

https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Communication.md#partthree

Test Suite : https://github.com/adlnet/lrs-conformance-test-suite

Oracle Learning specific validations:

17 Business / Technical Brief / Learning Experience API (xAPI) / Version 2.0


Copyright © 2024, Oracle and/or its affiliates / Public
VALIDATION ERROR MESSAGE WHEN FAILED

Actor (Learner) should be valid No Error in the response but statement will be marked failed. While processing the
statement actor will be validated against HCM persons. If actor is invalid, i.e. no
person record is found, statement will be marked as failed and won’t be processed
anymore

Verb should be one of the Oracle 400 Error


Learning supported verbs
WLF_LRS_ERROR_CODE_INVALID_STMT <Verb> is not a valid OLC verb.

User must have the required 403 authentication failed.


privilege to post xAPI statement

Only accept mbox and account 400


attributes for actor
mbox and account are the only valid account attributes

Time stamp: should be in UTC No error message but during processing it will be assumed to be in UTC.
format

Table 11. Oracle Learning specific validations

xAPI standards validation

Test Suite : https://github.com/adlnet/lrs-conformance-test-suite

VALIDATIONS USE CASES

Id Property Requirements • Id must be a UUID. If Id is not provided in the POST request, code will
generate it automatically.

Versioning Validations • Should fail when Statement POST/PUT/GET without header "X-
Experience-API-Version". The value should in format "1.0.x"
• An LRS sends a header response with "X-Experience-API-Version" as the
name and the latest patch version after "1.0.0" as the value

Verb Property Validations • Verb Id should not be null and should be a valid IRI.
• Statement Verb "display" should be an object. It should fail when display is
defined as numeric or string.

Object Validations • Statement Object Id should not be null and should be a valid IRI.
• Object Definition "type", if present should be a valid IRI.
• Object Type if present should have the value "Activity".
• Object Definition should fail when not declared as object.
• Object Extensions should fail when not declared as object.

Statement Lifecycle Requirements • should return 404 when no statement is returned using GET with
"statementId"

Result Property Requirements • Statement result score.scaled must be between -1.0 and 1.0 (inclusive).
• statement result "score.raw" must be less than or equal to score.max and
greater than or equal to score.min

18 Business / Technical Brief / Learning Experience API (xAPI) / Version 2.0


Copyright © 2024, Oracle and/or its affiliates / Public
VALIDATIONS USE CASES

• statement result "score.min" must be smaller than or equal to


"score.max"
• Statement result duration should be in valid ISO 8601 duration format.
• statement result "success" property should be "true" or "false"
• statement result "completion" property should be "true" or "false"
• statement result "response" property should be numeric
• Statement result score must be represented as a JSON object in the
statement(replace the above bullet)

Error Code validations • Should reject with error code 400 Bad Request any request to a Resource
which uses a parameter not recognized by the LRS
• In case of multiple statements in a request, should not persist any
statement when there is a failure.

Stored property validations • Using POST, LRS must accept statements with stored property.

Timestamp Property Validations • Should fail when statement has invalid string in timestamp.
• Should fail when statement has invalid date in timestamp.
• Should be in ISO 8601 format.

Special Data Types and Rules • Statement Activity extension key should fail when key is invalid IRI.
• Statement Result extension key should fail when key is invalid IRI.
• Should reject statements having timestamp with -00 offset.
• Should reject statements having timestamp with -0000 offset.
• Should reject statements having timestamp with -00:00 offset.
• Statement must contain a timestamp property when retrieved using a
GET operation.
• Statement must contain a stored property when retrieved using a GET
operation.

• Should fail when result "duration" property is invalid string, number,


object and invalid duration.

Actor Validations • Statement actor "objectType" should be "Agent"


• Statement actor "name" should be a string.
• In a request, either mbox Or Account should be present. Both should not
be present at the same time.
• Statement actor "agent mbox" should be proper IRI and in the format
mailto:email address

Encoding Requirements • All Strings are encoded and interpreted as UTF-8

Formatting Requirements • statement verb should fail when display language map has a key with null
value
• statement object must not be empty
• should fail when attributes have string where numbers are required
• should fail when attributes have number when strings are required
• should fail when attributes have strings where Boolean is required
• statementId should be UUID
• statement actor "agent" account "name" property should be string
• should fail when any of these is not present in the statement: "id", "actor",
"verb", "object", "timestamp", "version"
• An LRS rejects a not well-created JSON Object

19 Business / Technical Brief / Learning Experience API (xAPI) / Version 2.0


Copyright © 2024, Oracle and/or its affiliates / Public
Table 12. xAPI standard validations

Sample Payloads

Sample 1- verbs that mark a learner in progress


initialized, experienced

Note - Result element is not included in this sample as its optional.

PROPERTY VALUE

Request https://{{host}}/hcmRestApi/redwood/xAPI/statements

Operation POST

Headers X-Experience-API-Version : 1.0.0

Request {
Payload "actor": {
"account": {
"name": "learnimpl",
"homePage": "https://oraclesandbox.oracle.com"
},
"objectType": "Agent"
},
"verb": {
"display": {
"en": "initialized"
},
"id": "https:\/\/fanyv88.com:443\/http\/adlnet.gov\/expapi\/verbs\/initialized"
},
"object": {
"definition": {
"name": {
"en": "Leading in the Age of Generative AI"
},
"type": "https:\/\/fanyv88.com:443\/https\/w3id.org\/xapi\/video\/activity-type\/course"
},
"id": "https:\/\/fanyv88.com:443\/https\/xapi.provider.com\/xapi\/course\/OLC4323232",
"objectType": "Activity"
},
"id":"{{$randomUUID}}",
"version": "1.0.0",
"timestamp": "2024-02-07T06:09:57.290Z"
}

Response 200 OK

[
"ec572ce3-9f34-429f-80c1-ef682037c7f2"
]

Table 13. Sample payload #1

Sample 2 - statement to mark learner completed


completed, satisfied, scored, unSatisfied
20 Business / Technical Brief / Learning Experience API (xAPI) / Version 2.0
Copyright © 2024, Oracle and/or its affiliates / Public
PROPERTY VALUE

Request https://{{host}}/hcmRestApi/redwood/xAPI/statements

Operation POST

Headers X-Experience-API-Version : 1.0.0

Request {
Payload "actor": {
"account": {
"name": "learnimpl",
"homePage": "https:\/\/fanyv88.com:443\/https\/oraclesandbox.oracle.com"
},
"objectType": "Agent"
},
"verb": {
"display": {
"en": "scored"
},
"id": "https:\/\/fanyv88.com:443\/https\/w3id.org\/xapi\/dod-isd\/verbs\/scored"
},
"object": {
"definition": {
"name": {
"en": "Leadership Transitions: Moving into Senior Leadership"
},
"type": "https:\/\/fanyv88.com:443\/https\/adlnet.gov\/exapi\/activities\/course"
},
"id": "https:\/\/fanyv88.com:443\/https\/xapi.provider.com\/xapi\/course\/badfc56a-bb6b-4aa3",
"objectType": "Activity"
},
"result": {
"duration": "PT20M39S",

"score": {
"raw": 56,
"min": 0,
"max": 100
}
},
"version": "1.0.0",
"timestamp": "2023-10-01T06:09:57.290Z"
}

Response 200 OK

[
"ec572ce3-9f34-9f-80c1-ef682037c7f543"
]

Table 14. Sample payload #2

Sample 3- statement to mark learner exempted


waived

PROPERTY VALUE

Request https://{{host}}/hcmRestApi/redwood/xAPI/statements

Operation POST

Headers X-Experience-API-Version : 1.0.0

21 Business / Technical Brief / Learning Experience API (xAPI) / Version 2.0


Copyright © 2024, Oracle and/or its affiliates / Public
PROPERTY VALUE

Request {
Payload "actor": {
"account": {
"name": "learnimpl",
"homePage": "https:\/\/fanyv88.com:443\/https\/oraclesandbox.oracle.com"
},
"objectType": "Agent"
},
"verb": {
"display": {
"en": "waived"
},
"id": "https:\/\/fanyv88.com:443\/https\/w3id.org\/xapi\/dod-isd\/verbs\/waived"
},
"object": {
"definition": {
"name": {
"en": "Leadership Transitions: Moving into Senior Leadership"
},
"type": "https:\/\/fanyv88.com:443\/https\/adlnet.gov\/exapi\/activities\/course"
},
"id": "https:\/\/fanyv88.com:443\/https\/xapi.provider.com\/xapi\/course\/badfc56a-bb6b-4aa3",
"objectType": "Activity"
},
"version": "1.0.0",
"timestamp": "2023-10-01T06:09:57.290Z"

Response 200 OK

[
"ec572ce3-9f34-9f-80c1-ef682037c7f543"
]

Table 15. Sample payload #3

Manual Processing of statements


While xAPI statements will be processed near real time in a synchronous manner, there may be some statements
that weren't processed real time for some reason and need to be retried. Schedule the ESS job "Process learning
experience statements" to run once daily, to handle manual processing of such statements.

22 Business / Technical Brief / Learning Experience API (xAPI) / Version 2.0


Copyright © 2024, Oracle and/or its affiliates / Public
FAQ’s
1) What happens if an xapi statement is sent for a learner, but learner isn't enrolled to the learning item?

In this case, while processing the xAPI statement, Oracle Learning will create a net new voluntary enrollment for the
learner and update the status according to the information in xAPI statement.

2) What happens is learner has already completed the learning item and a new xAPI statement is sent?
In this case, Oracle Learning will create a net new voluntary enrollment for the learner and update the status
according to the information in xAPI statement.

3) What happens if learner or admin withdraws the learner from the active enrolment and an xAPI statement is sent
saying learner completed the learning item?

If an active enrolment is not found, a net new voluntary enrollment will be created for the learner and will be updated
to completed.

Helpful Resources
1) About xAPI

2) xAPI specifications

3) xAPI Test Suite

23 Business / Technical Brief / Learning Experience API (xAPI) / Version 2.0


Copyright © 2024, Oracle and/or its affiliates / Public
Connect with us

Call +1.800.ORACLE1 or visit oracle.com. Outside North America, find your local office at: oracle.com/contact.

blogs.oracle.com facebook.com/oracle twitter.com/oracle

Copyright © 2024, Oracle and/or its affiliates. All rights reserved. This document is Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be
provided for information purposes only, and the contents hereof are subject to change trademarks of their respective owners.
without notice. This document is not warranted to be error-free, nor subject to any other
Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC
warranties or conditions, whether expressed orally or implied in law, including implied
trademarks are used under license and are trademarks or registered trademarks of SPARC
warranties and conditions of merchantability or fitness for a particular purpose. We
International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or
specifically disclaim any liability with respect to this document, and no contractual
registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open
obligations are formed either directly or indirectly by this document. This document
Group. 0120
may not be reproduced or transmitted in any form or by any means, electronic or
mechanical, for any purpose, without our prior written permission. Disclaimer: If you are unsure whether your data sheet needs a disclaimer, read the revenue
recognition policy. If you have further questions about your content and the disclaimer
This device has not been authorized as required by the rules of the Federal
requirements, e-mail [email protected].
Communications Commission. This device is not, and may not be, offered for sale or
lease, or sold or leased, until authorization is obtained.

24 Business / Technical Brief / Learning Experience API (xAPI) / Version 2.0


Copyright © 2024, Oracle and/or its affiliates / Public

You might also like