xAPI Integration

About the integration

DataCamp can integrate with an LMS or LRS that supports the xAPI standard. If an integration is active, we can send started, completion and progress statements to the xApi endpoint provided by your LMS.

Authentication

DataCamp supports two ways of authenticating to the xAPI endpoint:

  • Via basic auth, in which case a username and password is required
  • Via bearer auth, in which case a token is required

Completions sync process

DataCamp can sync content completions via xAPI. This includes completions for courses, projects, practice, assessments and course chapters. 

For every completion, an xAPI statement is sent to the LMS. Statements are synced close to real-time, which means that if a learner completes a content item on DataCamp, it can take up to a maximum of 5 minutes for the LMS to receive the corresponding completion statement. 

Started event sync process

Next to content completion events, DataCamp can also sync started events. Currently started events are only available for courses. A started event is emitted when a learner completes the first exercise in a course.

Similar to completion statements, started event statements are also sent close to real-time. 

Progress sync process

DataCamp can also send progress statements. Currently, progress statements are only sent for courses. Each time a learner completes a chapter, DataCamp sends a statement containing the percentage of the course the learner has completed.

Similar to completion and started event statements, progress statements are also sent close to real-time. 

User identifiers

To identify users in statements, two types of identifiers are possible:

  • Email: in this case, we use the email address registered on the platform for the user;
  • NameID: when SSO is enabled for your organization, you can configure your IDP to send employee IDs as the NameID. This NameID is stored on the DataCamp side and used as the user identifier for a statement.

Example statements

The following are a few example statements to show how the statements sent by DataCamp look like.

Completion statement using e-mail user identifiers

{
  "actor": {
    "mbox": "mailto:test@example.com",
    "objectType": "Agent"
  },
  "timestamp": "2023-02-08T14:44:01.267Z",
  "verb": {
    "id": "http://adlnet.gov/expapi/verbs/completed",
    "display": { "en-US": "COMPLETED" }
  },
  "object": { 
    "id": "http://datacamp.com/course/123"
  }
}

Completion statement using nameid user identifiers

{
  "actor": {
    "account": {
      "name": "emp_001",
      "homePage": "https://www.datacamp.com"
    },
    "objectType": "Agent"
  },
  "timestamp": "2023-02-08T14:44:01.267Z",
  "verb": {
    "id": "http://adlnet.gov/expapi/verbs/completed",
    "display": { "en-US": "COMPLETED" }
  },
  "object": { 
    "id": "http://datacamp.com/course/123"
  }
}

Completion statement for a course chapter

{
  "actor": {
    "mbox": "mailto:test@example.com",
    "objectType": "Agent"
  },
  "timestamp": "2023-02-08T14:48:18.740Z",
  "verb": {
    "id": "http://adlnet.gov/expapi/verbs/completed",
    "display": {
      "en-US": "COMPLETED"
    }
  },
  "object": {
    "id": "http://datacamp.com/course-chapter/412",
    "definition": {
      "extensions": {
        "http://datacamp.com/parentId": "http://datacamp.com/course/123", 
        "http://datacamp.com/parentContentType": "http://datacamp.com/course"
      }
    }
  }
}

Started event statement using e-mail user identifiers

{
  "actor": {
    "mbox": "mailto:test@example.com",
    "objectType": "Agent"
  },
  "timestamp": "2023-02-08T14:44:01.267Z",
  "verb": {
    "id": "https://activitystrea.ms/schema/1.0/start",
    "display": { "en-US": "STARTED" }
  },
  "object": { 
    "id": "http://datacamp.com/course/123"
  }
}

Progress statement

{
  "actor": {
    "mbox": "mailto:test@example.com",
    "objectType": "Agent"
  },
  "timestamp": "2023-02-08T14:50:27.571Z",
  "verb": {
    "id": "http://adlnet.gov/expapi/verbs/progressed",
    "display": {
      "en-US": "PROGRESSED"
    }
  },
  "object": {
    "id": "http://datacamp.com/course/123",
    "definition": {
      "extensions": {
        "http://datacamp.com/percentCompleted": 75
      }
    }
  }
}

Prerequisites

Before setting up an xAPI integration, the following requirements must be met:

  • An active enterprise subscription on DataCamp;
  • An LMS or LRS that supports receiving xAPI statements;
  • (optional) Have SSO set up on DataCamp, and
  • If user identifiers should be NameIDs, have your IDP set up to send them in the NameID field, and have the NameID format set to “urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified

Setup

In order to set up an xAPI integration, start by configuring your LMS or LRS to receive xAPI statements from DataCamp. Furthermore, make sure credentials are created for DataCamp to authenticate to the LMS.

Next, provide DataCamp with the following information:

  • Your xAPI endpoint;
  • The credentials (username/password for basic auth or a token for bearer auth);
  • Which statements should be sent (completion, progress and/or started);
  • If completion statements should be sent, which content type completions should be included;
  • Whether e-mail addresses or NameIDs should be used as user identifiers

DataCamp will then use this information to set up and test the integration.