Introduction
Hello fellow developer! đź‘‹
You can get an key API for your account under the Settings menu, API Keys (available for all paid plans).
Currently, API keys are giving total access to the account, as the account owner would. Keep this in mind as when we add new endpoints to the API, the existing API keys will get access too.
API feedback
You need other things? You have suggestions for us?
Your feedback is greatly appreciated at tech@didacte.com.
Authentication
# With shell, you only need to send the correct header with each request
curl "https://api.didacte.com/v1/whoami" \
-H "X-API-Key: {{insert-api-key}}"
200 OK - Correct API key
{
"whoami": {
"slug": "ressources",
"name_translations": {
"en": "Workleap LMS",
"fr": "Workleap LMS"
},
"short_description_translations": {
"en": "Workleap LMS offers you several formations",
"fr": "Workleap LMS t'offre plusieurs formations"
}
}
401 Unauthorized - Incorrect key
{
"errors": [
{
"code": "UNKOWN_API_KEY",
"title": "Unknown API Key"
}
]
}
Workleap LMS public API is available at https://api.didacte.com/v1/
.
Workleap LMS expects the API key to be included in all API requests to the server in a header that looks like the following:
X-API-Key: {{insert-api-key}}
Pagination
Expect all resource-listing endpoints to be paginated, unless specified otherwise.
The limit is documented on each resource list endpoint and may vary depending on the resources size.
Most endpoints pagination use a page number (?page=2
) parameter.
Some endpoints with a lot of streaming data (like events) use an offset id like ?after_offset=526a319c-2c0e-464b-a529-14f7b955fe45
or ?before_offset=526a319c-2c0e-464b-a529-14f7b955fe45
.
Filters
Filtering by multiple ids
Some endpoint filters accept an array of values like ids
.
This type of parameter should be an array of values encoded in the URL (ex. ?ids[]=104717&ids[]=934158
).
curl --request GET 'https://api.didacte.com/v1/users?ids[]=104717&ids[]=934158' \
--header 'X-API-Key: {{insert-api-key}}'
Rate limit
Every account has a limit of requests per second.
When you make too many requests to our API, it will return 429 Too Many Requests
responses.
If you get those errors, you should first consider throttling your code speed to ensure you do not make too many requests rapidly.
For example, if you need to create 1000 users once, we will not raise your limit to accept 1000 requests within 5 seconds. Throttle your script by adding a short wait time between every request (ex. 500ms) to create them more slowly, over a few minutes.
If case throttling is not enough or not possible, contact us at tech@didacte.com with detailed explanations of your use case.
Users
User resource
Attribute | Type | Description |
---|---|---|
bio | string | User biography |
country_code | string | User country code (ISO alpha 2) |
created_at | time | User creation time (read only) |
string | User email | |
email_bounce | boolean | User had a Workleap LMS email bounce (read only, may be null) |
email_complaint | boolean | User has reported Workleap LMS email as spam (read only, may be null) |
external_id | string | User identifier (for use by third party using the API) |
id | integer | User identifier (read only) |
invitation_accepted_at | time | User invite acceptance time (read only, may be null) |
invitation_sent_at | time | User invite sent time (read only, may be null) |
last_sign_in_at | time | User last sign in time (read only, may be null) |
locale | string | User preferred locale (en , fr ) |
name | string | User full name |
profile | object | User custom profile fields |
provider_id | integer | Identifier for related provider (for users with an administrative role - read only) |
role | string | User role (read only) |
state_code | string | User state/province code (ISO sub-territory code) |
taxon_ids | integer or array | Identifier for related taxon(s) |
updated_at | time | User last update time (read only) |
Attributes values
user.locale
The user locale must be one configured in your Workleap LMS platform general setting to be valid.
user.country_code / user.state_code
We use the Carmen gem to validate geographic codes which itself is based on the iso-codes Debian package.
user.profile
Only available when configured on your platform (contact support for more details).
These custom fields must be provided and valid when they are configured.
For fields with an options list, the value provided to the API must be the stored value and not the localized label we show to your users. Ask us for your user profile schema if you are not sure of it.
user.role
The public API only allow the creation to create user with student
role.
However, you can fetch existing users which may have a different role.
Possible roles are:
- admin
- contact_person
- provider
- student
- teacher
user.taxon_ids
The user taxons are the groups found under Users, Groups in your Workleap LMS platform. They are not (yet) available in the public API, but you can still configure them on your users.
Create a user
curl --request POST 'https://api.didacte.com/v1/users' \
--header 'X-API-Key: {{insert-api-key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"user": {
"name": "Sample User",
"locale": "fr",
"send_invitation_email": false,
"email": "user@example.com",
"country_code": "CA",
"state_code": "QC",
"external_id": "test123456",
"bio": "Hello",
"taxon_ids": [
123
],
"profile": {
"birthday": "1989-04-26",
"gender": "male",
"postal_code": "G1K0E5",
"phone": "418-888-8888",
"address": "520 de la Salle",
"city": "Québec"
}
}
}'
200 OK - Returns created user
{
"user": {
"admin": false,
"bio": "Hello",
"country_code": "CA",
"created_at": "2022-01-04T16:37:08.206-05:00",
"email": "user@example.com",
"email_bounce": null,
"email_complaint": null,
"external_id": "test123456",
"id": 1086634,
"invitation_accepted_at": null,
"invitation_sent_at": "2022-01-04T16:37:08.489-05:00",
"last_sign_in_at": null,
"locale": "fr",
"name": "Sample User",
"newsletter": false,
"profile": {
"birthday": "1989-04-26",
"gender": "male",
"postal_code": "G1K0E5",
"phone": "418-888-8888",
"address": "520 de la Salle",
"city": "Québec"
},
"provider_id": null,
"role": "student",
"state_code": "QC",
"taxon_ids": [],
"updated_at": "2022-01-04T16:37:08.489-05:00"
}
}
422 Unprocessable - Errors details
{
"errors": {
"country_code": [
"is not included in the list"
],
"name": [
"can't be blank"
],
"locale": [
"is not included in the list"
],
"email": [
"is invalid"
],
"external_id": [
"has already been taken"
]
}
}
When you create a user, Workleap LMS sends an invitation email for the user to confirm his email and choose his password.
The invitation email subject is Invitation to activate your account on {{Workleap LMS platform name}}
and is sent from no-reply@didacte.com
with a reply-to set to your Workleap LMS platform contact email.
You can skip this email by setting send_invitation_email
to false
.
Creating a user that will log in via Single Sign-On
After creating a user, you must create an associated Identity for the given SSO method (like Workleap LMS JWT). Otherwise, a new user won't be authorized to log in via any external method.
When creating users that will be using SSO, you may want to skip the invitation email. In that case, don't forget to set send_invitation_email
to false
.
For more information about Workleap LMS JWT, see Workleap LMS JWT SSO guide.
Update user
curl --request PUT 'https://api.didacte.com/v1/users/:user_id' \
--header 'X-API-Key: {{insert-api-key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"user": {
"name": "Sample User",
"locale": "en",
"email": "user@example.com",
"country_code": "CA",
"state_code": "QC",
"external_id": "api123",
"bio": "Hello",
"taxon_ids": [
123
]
}
}'
200 OK
{
"user": {
"admin": true,
"bio": "Hello",
"country_code": "CA",
"created_at": "2017-03-14T10:46:08.644-04:00",
"email": "user@example.com",
"email_bounce": null,
"email_complaint": null,
"external_id": "api123",
"id": 20979,
"invitation_accepted_at": null,
"invitation_sent_at": null,
"last_sign_in_at": "2021-12-20T10:05:39.982-05:00",
"locale": "en",
"name": "Sample User",
"newsletter": false,
"profile": {},
"provider_id": 631,
"role": "provider",
"state_code": "QC",
"taxon_ids": [],
"updated_at": "2022-01-04T16:54:15.441-05:00"
}
}
Nothing very special to explain here.
List users
curl --request GET 'https://api.didacte.com/v1/users' \
--header 'X-API-Key: {{insert-api-key}}'
200 OK
{
"users": [
{
"admin": true,
"bio": "Professor of parapsychology",
"country_code": "CA",
"created_at": "2020-01-14T11:29:57.470-05:00",
"email": "user1@example.com",
"email_bounce": null,
"email_complaint": null,
"external_id": null,
"id": 104717,
"invitation_accepted_at": null,
"invitation_sent_at": null,
"last_sign_in_at": "2021-12-22T04:48:21.494-05:00",
"locale": "fr",
"name": "Peter Venkman",
"newsletter": false,
"profile": {},
"provider_id": 631,
"role": "provider",
"state_code": "QC",
"taxon_ids": [],
"updated_at": "2021-12-22T04:48:22.183-05:00"
},
{
"admin": false,
"bio": null,
"country_code": "CA",
"created_at": "2020-08-03T14:42:12.583-04:00",
"email": "user2@example.com",
"email_bounce": null,
"email_complaint": null,
"external_id": null,
"id": 934158,
"invitation_accepted_at": null,
"invitation_sent_at": null,
"last_sign_in_at": "2021-10-07T13:55:28.870-04:00",
"locale": "en",
"name": "Egon Spengler",
"newsletter": false,
"profile": {},
"provider_id": null,
"role": "student",
"state_code": "QC",
"taxon_ids": [
15841
],
"updated_at": "2021-12-16T15:25:38.504-05:00"
}
],
"meta": {
"total_count": 2,
"total_pages": 1
}
}
Pagination
The users API returns up to 25 users per page. You set the page with the page
param and access total count and total pages in the meta
key of the response.
Filters
Filters within the index have the same behaviors as the ones from the user interface.
Param | Type | Description |
---|---|---|
access | String | Get users with specific access (admin , provider , teacher , student ) |
external_id | integer | Get users with provided identifier |
ids | integer or array | Get users with provided identifier(s) |
keyword | string | Get users with specific search string |
scope | string | Get users with specific named filters (active , deactivated , invite_pending , email_bounce ) |
taxon_ids | integer or array | Get users with provided taxon(s) (only when using with_all_taxon_ids or with_any_taxon_id ) |
taxon_scope | string | Get users with provided taxon_scope |
Filtering by user keyword
The provided string will be matched against the following user attributes:
name
email
profile (identification field only)
Filtering by user taxons
User filtering by taxons is split in two params.
The taxon_scope
will define the logic used to filter. Its possible values are:
with_all_taxon_ids
(logicaland
- requirestaxon_ids
)with_any_taxon_id
(logicalor
- requirestaxon_ids
)without_taxon
with_any_taxon
The taxon_ids
limits the applied filter to the specified id(s). It must be combined with either with_all_taxon_ids
or with_any_taxon_id
to specify the filtering strategy.
Ordering
Param | Description |
---|---|
order_by | Order value (name , email or access ) |
order_dir | Order direction (asc or desc ) |
Show user
curl --request GET 'https://api.didacte.com/v1/users/:user_id' \
--header 'X-API-Key: {{insert-api-key}}'
200 OK
{
"user": {
"admin": false,
"bio": null,
"country_code": "CA",
"created_at": "2020-08-03T14:42:12.583-04:00",
"email": "user@example.com",
"email_bounce": null,
"email_complaint": null,
"external_id": null,
"id": 934158,
"invitation_accepted_at": null,
"invitation_sent_at": null,
"last_sign_in_at": "2021-10-07T13:55:28.870-04:00",
"locale": "en",
"name": "Egon Spengler",
"newsletter": false,
"profile": {},
"provider_id": null,
"role": "student",
"state_code": "QC",
"taxon_ids": [
15841
],
"updated_at": "2021-12-16T15:25:38.504-05:00"
}
}
Nothing very special to explain here.
Deactivate user
curl --request PUT 'https://api.didacte.com/v1/users/:user_id/deactivate' \
--header 'X-API-Key: {{insert-api-key}}'
200 OK
{}
With an Enterprise platform, deactivating a user will count toward your limit.
Activate
curl --request PUT 'https://api.didacte.com/v1/users/:user_id/activate' \
--header 'X-API-Key: {{insert-api-key}}'
200 OK
{}
422 Unprocessable - Limit reached
{
"errors": {
"base": [
"The user limit of this platform has been reached"
]
}
}
With an Enterprise platform, activating a user will count toward your limit.
Identities
Identity resource
An identity is a link between a Workleap LMS user and an external identity provider.
When a Workleap LMS user account already exists, we will require it to be logged and to confirm that they want to link their existing account to a new identity provider.
Creating an identity with the API will skip those verification steps.
Attribute | Type | Description |
---|---|---|
auth_config_id | integer | JWT configuration identifier (found in your platform under Settings, External Authentication) |
id | integer | Identifier (read only) |
provider | string | SSO provider (jwt is the only provider supported). |
uid | string | User identifier provided by the SSO provider (ex: the uid in the JWT payload) |
user_id | integer | Workleap LMS associated user identifier |
Create identity
curl --request POST 'https://api.didacte.com/v1/identities' \
--header 'X-API-Key: {{insert-api-key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"identity": {
"uid": "ext123",
"provider": "jwt",
"user_id": 1073090,
"auth_config_id": 74
}
}'
200 OK
{
"identity": {
"id": 16369,
"provider": "jwt",
"auth_config_id": 74,
"user_id": 1073090,
"uid": "ext123"
}
}
422 Unprocessable - Error details
{
"errors": {
"user": [
"can't be blank"
],
"auth_config": [
"can't be blank"
],
"provider": [
"is not included in the list"
]
}
}
Creating an identity confirms to us that the Workleap LMS user identified by user_id
is the same person as the user identified by uid
via the given provider. After creating an identity, our verification process will be skipped when using this provider to log in with this Workleap LMS user.
Update identity
curl --request PUT 'https://api.didacte.com/v1/identities/:identity_id' \
--header 'X-API-Key: {{insert-api-key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"identity": {
"uid": "new_id_changed",
"provider": "jwt",
"user_id": 1073090,
"auth_config_id": 74
}
}'
200 OK
{
"identity": {
"id": 16369,
"provider": "jwt",
"auth_config_id": 74,
"user_id": 1073090,
"uid": "new_id_changed"
}
}
You should only update the uid
attribute if the identifier changed on your identity provider.
Delete identity
curl --request DELETE 'https://api.didacte.com/v1/identities/:identity_id' \
--header 'X-API-Key: {{insert-api-key}}'
200 OK
{}
It should always be possible to delete an identity.
List identities
curl --request GET 'https://api.didacte.com/v1/identities?page=1&provider=jwt&user_id=1073090&uid=ext123' \
--header 'X-API-Key: {{insert-api-key}}'
200 OK
{
"identities": [
{
"id": 16370,
"provider": "jwt",
"auth_config_id": 74,
"user_id": 1073090,
"uid": "ext123"
}
],
"meta": {
"total_count": 1,
"total_pages": 1
}
}
Pagination
The identities API returns up to 100 identities per page. You set the current page with the page
param and access the total identities and pages count in the meta
key of the response.
Filters
Param | Description |
---|---|
auth_config_id | Get identities for a specific JWT configuration |
provider | Get identities by SSO provider (possible values: jwt ) |
uid | Get identities with provided uid |
user_id | Get identity for a specific Workleap LMS user |
Ordering
There is no ordering options on this endpoint. Need something? Get in touch!
Show identity
curl --request GET 'https://api.didacte.com/v1/identities/:identity_id' \
--header 'X-API-Key: {{insert-api-key}}'
200 OK
{
"identity": {
"id": 16370,
"provider": "jwt",
"auth_config_id": 74,
"user_id": 1073090,
"uid": "ext123"
}
}
Shows information for a specific identity.
Courses
Course resource
This API gives you access to multiple attributes for a course (but not to its content).
Attribute | Type | Description |
---|---|---|
bill90_eligible | boolean | Eligibility for Bill 90 (default false ) |
card_image_url | string | Image URL for course card |
course_url | string | Course's Workleap LMS URL |
created_at | time | Course creation time (read only) |
description | text | Course description |
duration | integer | Course duration in minutes (may be null) |
has_attestation | boolean | Course provides an attestation on completion (default false ) |
id | integer | Course identifier (read only) |
is_visible | boolean | Course visibility status (default true ) |
locale | string | Course language (en , fr ) |
name | string | Course name (max 255 characters) |
objectives | string | Course objective (may be null) |
price | integer | Course price in cents (may be null) |
provider_id | integer | Identifier for related provider (may be null) |
published_at | time | Course publication time (null if not published) |
short_description | string | Course short description (max 165 characters, may be null) |
target_audience | string | Course target audience (may be null) |
teacher_id | integer | Identifier for related teacher user |
teaser_image_url | string | Image URL for course teaser |
updated_at | time | Course last update time (read only) |
Attributes values
course.bill90_eligible
This field indicates if a course is eligible for Quebec's Bill 90 (this feature is available only for Enterprise plans in Quebec).
course.card_image_url / course.teaser_image_url
The image paths are public Cloudfront/S3 URLs which may change after a certain time. If you need these images, it is recommended that you save them and use your own copy to ensure you keep the access.
course.is_visible
This field is used to make course private and allow only manual enrolls (this feature is exclusive to the Enterprise plans). Please note that the visibility
and published
status are two different attributes.
List courses
curl --request GET 'https://api.didacte.com/v1/courses' \
--header 'X-API-Key: {{insert-api-key}}'
200 OK
{
"courses": [
{
"bill90_eligible": false,
"created_at": "2017-04-25T15:56:10.614-04:00",
"duration": null,
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
"has_attestation": true,
"id": 1234,
"is_visible": false,
"locale": "en",
"name": "API 101 - The courses",
"objectives": "Nunc non blandit massa enim nec dui nunc mattis enim ut tellus elementum",
"price": 10000,
"provider_id": 300,
"published_at": "2021-11-14T22:19:41.140-05:00",
"short_description": "Commodo ullamcorper a lacus vestibulum sed arcu",
"target_audience": "At risus viverra adipiscing at in tellus integer feugiat scelerisque varius",
"teacher_id": 666,
"updated_at": "2021-11-14T22:19:41.148-05:00",
"course_url": "http://example.didacte.com/a/course/1234/description",
"card_image_url": "https://d10lqe7a97oa2.cloudfront.net/courses/card_images/1234/567/890/123/default/photo-7378954651232-5d716f45d604?1623871709",
"teaser_image_url": "https://d10lqe7a97oa2.cloudfront.net/courses/card_images/8921/000/022/186/default/photo-7378954651232-5d716f45d604?1623871709"
},
{
"bill90_eligible": true,
"created_at": "2018-04-05T15:42:39.115-04:00",
"duration": 420,
"description": "Gravida bum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus mauris vitae ultricies leo integer malesuada",
"has_attestation": false,
"id": 3777,
"is_visible": true,
"locale": "en",
"name": "API 102 - More courses!",
"objectives": null,
"price": 0,
"provider_id": 300,
"published_at": "2021-11-14T22:21:01.834-05:00",
"short_description": null,
"target_audience": null,
"teacher_id": null,
"updated_at": "2021-11-14T22:21:01.841-05:00",
"course_url": "http://example.didacte.com/a/course/3777/description",
"card_image_url": null,
"teaser_image_url": null
}
],
"meta": {
"total_count": 21,
"total_pages": 3
}
}
Returns a paginated list of courses.
Pagination
The courses API returns up to 25 courses per page. You set the page with the page
param and access total count and total pages in the meta
key of the response.
Filters
Param | Type | Description |
---|---|---|
access | string | Get courses with course access type |
course_locale | string | Get courses with language (en , fr ) |
credit_ids | integer or array | Get courses having provided course credit identifier(s) |
ids | integer or array | Get courses with provided identifier(s) |
keyword | string | Get courses with specific search string |
occurrence_type | string | Get courses for occurrence type(online or classroom ) |
plan_id | integer | Get courses for provided subscription plan identifier |
provider_id | integer | Get courses for provider |
published | boolean | Get courses with publication status (true or false ) |
taxon_ids | integer or array | Get courses with provided taxon(s) |
teacher_id | integer | Get courses for teacher user |
Filtering by course access
This filter will return course based on the provided access type.
Possible values for this filter:
free
paid
subscription
manual_enroll
enrollment_request
Filtering by course keyword
The provided string will be matched against the following course attributes:
name
description
objectives
target_audience
teacher.name
teacher.bio
provider.name
Filtering by course taxons
This filter will accept one or multiple taxon_id
. Please note that only results that match all taxons will be returned.
Ordering
An orderBy
(camel case) param can be used to change the ordering for the courses.
The orderDir
(camel case) param can be used in combination with orderBy
to specify the direction of the ordering.
Param | Description |
---|---|
credits | Orders by the number of credit for this course |
id | Orders by numericality of the ids |
name | Orders by course name alphabetically |
price | Orders by price numericality |
Possible values for orderDir
are asc
or desc
(default).
Show course
curl --request GET 'https://api.didacte.com/v1/courses/:course_id' \
--header 'X-API-Key: {{insert-api-key}}'
200 OK
{
"course": {
"bill90_eligible": false,
"created_at": "2017-04-25T15:56:10.614-04:00",
"duration": null,
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
"has_attestation": true,
"id": 1234,
"is_visible": false,
"locale": "en",
"name": "API 101 - The courses",
"objectives": "Nunc non blandit massa enim nec dui nunc mattis enim ut tellus elementum",
"price": 10000,
"provider_id": 300,
"published_at": "2021-11-14T22:19:41.140-05:00",
"short_description": "Commodo ullamcorper a lacus vestibulum sed arcu",
"target_audience": "At risus viverra adipiscing at in tellus integer feugiat scelerisque varius",
"teacher_id": 666,
"updated_at": "2021-11-14T22:19:41.148-05:00",
"course_url": "http://example.didacte.com/a/course/1234/description",
"card_image_url": "https://d10lqe7a97oa2.cloudfront.net/courses/card_images/1234/567/890/123/default/photo-7378954651232-5d716f45d604?1623871709",
"teaser_image_url": "https://d10lqe7a97oa2.cloudfront.net/courses/card_images/8921/000/022/186/default/photo-7378954651232-5d716f45d604?1623871709"
}
}
Returns a single course resource.
Authors
Author resource
An author is a link between a user and a course.
It grants editing permissions to the user that is added as an author of a given course.
Attribute | Type | Description |
---|---|---|
id | integer | Identifier (read only) |
course_id | integer | Workleap LMS associated course identifier |
user_id | integer | Workleap LMS associated user identifier |
Create author
curl --request POST 'https://api.didacte.com/v1/authors' \
--header 'X-API-Key: {{insert-api-key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"author": {
"course_id": 197,
"user_id": 2
}
}'
200 OK
{
"author": {
"id": 1,
"course_id": 197,
"user_id": 2
}
}
422 Unprocessable - Error details
{
"errors": {
"user": [
"has already been taken"
]
}
}
The following limitations applies when creating an author:
- The user must have the same provider as the course
- The user must have a role of author or a higher role (admin, provider, teacher)
Delete author
curl --request DELETE 'https://api.didacte.com/v1/authors/:author_id' \
--header 'X-API-Key: {{insert-api-key}}'
200 OK
{}
It should always be possible to delete an author.
List authors
curl --request GET 'https://api.didacte.com/v1/authors?page=1&course_id=197&user_id=2' \
--header 'X-API-Key: {{insert-api-key}}'
200 OK
{
"authors": [
{
"id": 1,
"course_id": 197,
"user_id": 2,
}
],
"meta": {
"total_count": 1,
"total_pages": 1
}
}
Pagination
The authors API returns up to 25 authors per page. You set the current page with the page
param and access the total authors and pages count in the meta
key of the response.
Filters
Param | Description |
---|---|
course_id | Get authors for a specific Workleap LMS course |
user_id | Get authors for a specific Workleap LMS user |
Ordering
There is no ordering options on this endpoint. Need something? Get in touch!
Show author
curl --request GET 'https://api.didacte.com/v1/authors/:author_id' \
--header 'X-API-Key: {{insert-api-key}}'
200 OK
{
"author": {
"id": 1,
"course_id": 197,
"user_id": 2
}
}
Shows information for a specific author.
Occurrences
Occurrence resource
Occurrences are slightly different versions of a single course.
Every course has at least one, but may have many occurrences. Each occurrence is associated with a syllabus (the course content) and may have restrictions like a user limit or a limited registration period.
For in-person courses, occurrences will also have a date and a location.
Note: Enrollments are associated to an occurrence, not directly to a course so we can keep track of which version of the course the user is subscribed to.
Attribute | Type | Description |
---|---|---|
contact_id | integer | Identifier for related contact user (may be null) |
course_id | integer | Identifier for related course |
created_at | time | Occurrence creation time (read only) |
details | text | Occurrence details (may be null) |
end_at | time | Occurrence end time (may be null) |
hide_when_full | boolean | Hide occurrence when maximum enrollments reached (default true ) |
id | integer | Occurrence identifier (read only) |
location | string | Occurrence location details (max 255 characters, may be null) |
maximum_enrollments | integer | Occurrence enrollment limit (null if unlimited) |
name | text | Occurrence name |
occurrence_url | string | Occurrence's Workleap LMS URL |
registration_ends_at | time | Occurrence registrations end time (may be null) |
registration_starts_at | time | Occurrence registrations start time (may be null) |
start_at | time | Occurrence start time (may be null) |
syllabus_id | integer | Identifier for related syllabus |
timezone | string | Timezone used for start_time and end_time (may be null) |
type | string | Occurrence type (Occurrence::Classroom or Occurrence::Online ) |
updated_at | time | Occurrence last update time (read only) |
List occurrences
curl --request GET 'https://api.didacte.com/v1/occurrences' \
--header 'X-API-Key: {{insert-api-key}}'
200 OK
{
"occurrences": [
{
"contact_id": 123456,
"course_id": 75373,
"created_at": "2021-06-16T13:43:10.213-04:00",
"details": "Original version of the fantastic course",
"end_at": null,
"hide_when_full": true,
"id": 30000,
"location": null,
"maximum_enrollments": null,
"name": "Original version",
"registration_ends_at": null,
"registration_starts_at": null,
"start_at": null,
"syllabus_id": 44565,
"timezone": "America/Toronto",
"type": "Occurrence::Online",
"updated_at": "2021-06-16T15:35:04.298-04:00",
"occurrence_url": "http://example.didacte.com/a/course/75373v/description?occurrenceId=30000"
},
{
"contact_id": 123456,
"course_id": 556688,
"created_at": "2021-06-16T15:33:20.209-04:00",
"details": "Version without quiz",
"end_at": "2022-01-01T23:00:00.000-04:00",
"hide_when_full": false,
"id": 26280,
"location": "123, Sesame Street, Quebec",
"maximum_enrollments": null,
"name": null,
"registration_ends_at": "2021-07-03T15:30:00.000-04:00",
"registration_starts_at": "2021-07-03T14:30:00.000-04:00",
"start_at": "2022-01-01T20:00:00.000-04:00",
"syllabus_id": 17235,
"timezone": "America/Montreal",
"type": "Occurrence::Classroom",
"updated_at": "2021-06-16T15:33:20.209-04:00",
"occurrence_url": "http://example.didacte.com/a/course/556688/description?occurrenceId=26280"
}
],
"meta": {
"total_count": 21,
"total_pages": 3
}
}
Returns a paginated list of occurrences.
Pagination
The occurrences API returns up to 25 occurrences per page. You set the page with the page
param and access total count and total pages in the meta
key of the response.
Filters
Param | Type | Description |
---|---|---|
course_id | integer | Get occurrences for course |
from_published_course | boolean | Get occurrences for published courses only |
occurrence_ids | integer or array | Get occurrences with provided identifier(s) |
syllabus_id | integer | Get occurrences for syllabus |
upcoming_or_open_registration | boolean | Get occurrences which are open to registration |
Ordering
There is no ordering options on this endpoint, oldest occurrences are returned first. Need something? Get in touch!
Show occurrence
curl --request GET 'https://api.didacte.com/v1/occurrences/:occurrence_id' \
--header 'X-API-Key: {{insert-api-key}}'
200 OK
{
"occurrence": {
"contact_id": 123456,
"course_id": 556688,
"created_at": "2021-06-16T15:33:20.209-04:00",
"details": "Version without quiz",
"end_at": "2022-01-01T23:00:00.000-04:00",
"hide_when_full": false,
"id": 26280,
"location": "123, Sesame Street, Quebec",
"maximum_enrollments": null,
"name": null,
"registration_ends_at": "2021-07-03T15:30:00.000-04:00",
"registration_starts_at": "2021-07-03T14:30:00.000-04:00",
"start_at": "2022-01-01T20:00:00.000-04:00",
"syllabus_id": 17235,
"timezone": "America/Montreal",
"type": "Occurrence::Classroom",
"updated_at": "2021-06-16T15:33:20.209-04:00",
"occurrence_url": "http://example.didacte.com/a/course/556688/description?occurrenceId=26280"
}
}
Returns a single occurrence resource.
Syllabuses
Syllabus resource
A syllabus is the equivalent of a course plan.
It serves two purpose: - It acts as a container for each of the course's content parts - It manages the learning approach for its content
This API gives you access to the syllabuses settings and lets you know what approach each syllabus uses to present their content. It can either be a linear approach, which will requires the user to complete the lessons in a specific order, or let the student access the content in any order with the non-linear approach.
Drip content is also available for specific plans. With this, the lesson release schedule will be controlled by the admin.
Attribute | Type | Description |
---|---|---|
course_id | integer | Identifier for related course |
created_at | time | Syllabus creation time (read only) |
drip_starts_on | time | Date where content will begin to be released to enrolled users |
drip_timezone | string | Timezone used for drip_starts_on and drips_on_fixed_date |
drips_on_fixed_date | boolean | Syllabus content release setting (default false ) |
has_drip | boolean | Syllabus content release setting (default false ) |
id | integer | Syllabus identifier (read only) |
is_linear | boolean | Syllabus content access setting (default true ) |
name | string | Syllabus name |
updated_at | time | Syllabus last update time (read only) |
List syllabuses
curl --request GET 'https://api.didacte.com/v1/syllabuses' \
--header 'X-API-Key: {{insert-api-key}}'
200 OK
{
"syllabuses": [
{
"course_id": 1234,
"created_at": "2017-04-25T15:56:10.614-04:00",
"drip_starts_on": null,
"drip_timezone": null,
"drips_on_fixed_date": false,
"has_drip": false,
"id": 54321,
"is_linear": true,
"name": "Original syllabus",
"updated_at": "2021-06-16T13:43:10.209-04:00"
},
{
"course_id": 1234,
"created_at": "2021-06-16T15:33:20.201-04:00",
"drip_starts_on": "2021-11-14T22:19:41.140-05:00",
"drip_timezone": "America/Toronto",
"drips_on_fixed_date": false,
"has_drip": true,
"id": 654321,
"is_linear": true,
"name": "Original syllabus - With drip content",
"updated_at": "2021-06-16T15:33:57.815-04:00"
}
],
"meta": {
"total_count": 2,
"total_pages": 1
}
}
Returns a paginated list of syllabuses.
Pagination
The syllabuses API returns up to 25 syllabuses per page. You set the page with the page
param and access total count and total pages in the meta
key of the response.
Filters
Param | Type | Description |
---|---|---|
course_id | integer | Get syllabuses for course |
Ordering
There is no ordering options on this endpoint, oldest syllabuses are returned first. Need something? Get in touch!
Show syllabus
curl --request GET 'https://api.didacte.com/v1/syllabuses/:syllabus_id' \
--header 'X-API-Key: {{insert-api-key}}'
200 OK
{
"syllabus": {
"course_id": 1234,
"created_at": "2017-04-25T15:56:10.614-04:00",
"drip_starts_on": null,
"drip_timezone": null,
"drips_on_fixed_date": false,
"has_drip": false,
"id": 54321,
"is_linear": true,
"name": "Original syllabus",
"updated_at": "2021-06-16T13:43:10.209-04:00"
}
}
Returns a single syllabus resource.
Providers
Provider resource
The providers can represent an organization, a department or an individual person that adds content to the platform.
Each platform has an automatically created provider and can add some more to fit their needs.
Attribute | Type | Description |
---|---|---|
address | string | Provider street address (may be null) |
address2 | string | Provider street address details like apartment, suite or unit number (may be null) |
background_url | string | Image URL for provider background (may be null) |
city | string | Provider city (may be null) |
country_code | string | Provider country code (ISO alpha 2) |
created_at | time | Provider creation time (read only) |
description_translations | object | Provider translated description |
id | integer | Provider identifier (read only) |
logo_url | string | Image URL for provider logo(may be null) |
name | string | Provider name (max 255 characters) |
phone | string | Provider phone number (may be null) |
postal_code | string | Provider postal code / zip code (may be null) |
provider_url | string | Provider's Workleap LMS URL |
state_code | string | Provider state/provide code (ISO sub-territory code, may be null) |
updated_at | time | Provider last update time (read only) |
url | string | Provider's website URL (may be null) |
Attributes values
provider.background_url / provider.logo_url
The image paths are public Cloudfront/S3 URLs which may change after a certain time. If you need these images, it is recommended that you save them and use your own copy to ensure you keep the access.
provider.description_translations
Will return an object with languages codes as keys (en
, fr
) and translated string as value.
List providers
curl --request GET 'https://api.didacte.com/v1/providers' \
--header 'X-API-Key: {{insert-api-key}}'
200 OK
{
"providers": [
{
"address": "14 North Moore Street",
"address2": "Tribeca",
"city": "New York City",
"country_code": "US",
"created_at": "2022-06-24T16:03:56.186-04:00",
"description_translations": {
"en": "Professor of parapsychology and psychology",
"fr": "Professeur en parapsychologie et en psychologie"
},
"id": 555,
"name": "Peter Venkman",
"phone": "1-800-555-2368",
"postal_code": "10013",
"state_code": "NY",
"updated_at": "2022-06-24T16:03:56.186-04:00",
"url": "https://www.ghostbusters.com/",
"provider_url": "http://example.didacte.com/a/provider/555",
"logo_url": null,
"background_url": null
},
{
"address": null,
"address2": null,
"city": null,
"country_code": "CA",
"created_at": "2022-06-24T14:26:48.768-04:00",
"description_translations": {},
"id": 10644,
"name": "Winston Zeddemore",
"phone": null,
"postal_code": null,
"state_code": "QC",
"updated_at": "2022-06-24T14:26:48.768-04:00",
"url": null,
"provider_url": "http://example.didacte.com/a/provider/10644",
"logo_url": "https://d10lqe7a97oa2.cloudfront.net/providers/logos/8921/000/010/644/thumb/tmp_2F1036078_2F1656095328255_2Fghostbusters.png?1656095370",
"background_url": null
}
],
"meta": {
"total_count": 2,
"total_pages": 1
}
}
Returns a paginated list of providers.
Pagination
The providers API returns up to 25 providers per page. You set the page with the page
param and access total count and total pages in the meta
key of the response.
Filters
There are no filters associated with this endpoint
Ordering
There is no ordering options on this endpoint, providers are ordered alphabetically by name.
Show provider
curl --request GET 'https://api.didacte.com/v1/providers/:provider_id' \
--header 'X-API-Key: {{insert-api-key}}'
200 OK
{
"provider": {
"address": "14 North Moore Street",
"address2": "Tribeca",
"city": "New York City",
"country_code": "US",
"created_at": "2022-06-24T16:03:56.186-04:00",
"description_translations": {
"en": "Professor of parapsychology and psychology",
"fr": "Professeur en parapsychologie et en psychologie"
},
"id": 555,
"name": "Peter Venkman",
"phone": "1-800-555-2368",
"postal_code": "10013",
"state_code": "NY",
"updated_at": "2022-06-24T16:03:56.186-04:00",
"url": "https://www.ghostbusters.com/",
"provider_url": "http://example.didacte.com/a/provider/555",
"logo_url": null,
"background_url": null
}
}
Returns a single provider resource.
Enrollments
Enrollment resource
An enrollment is the access given to a user to a course through an occurrence.
A course may have one or many occurrences. Each occurrence is associated with a syllabus (the course content) and may have restrictions like a user limit or a limited registration period.
For in-person courses, occurrences will also have a date and a location.
Note: occurrences are called versions for an online course and session for an in-person course in the application interface. Both are occurrences in the API.
Attribute | Type | Description |
---|---|---|
active | boolean | Enrollment status (false when enrolled via a membership that is inactive) |
completed_at | time | Enrollment completion time (null until user completes the course - read only) |
continue_url | string | Workleap LMS URL where the user can begin/resume their progression in the course |
created_at | time | Enrollment creation date (read only) |
enroll_method | string | Enrollment enroll method (read only) |
expired_at | time | An expired enrollment cannot be accessed by the enrollee. Enrollments can expire when the related course is setup for requalification. Once the requalification period starts, the enrollment expires and the user must enroll again. (null until the enrollment expires - read only) |
id | integer | Enrollment identifier (read only) |
occurrence_id | integer | Identifier for related occurrence |
updated_at | time | Enrollment last update time (read only) |
user_id | integer | Identifier for the enrolled user |
Attributes values
enrollment.continue_url
Note that the user must be logged to access the continue_url
. If you are using the JWT SSO, we suggest that you build a JWT URL with the redirect_url
set to the continue_url
of the desired enrollment. This way the user is logged in and then redirected to the continue_url
.
enrollment.enroll_method
API
(enrolled via the public API)Free
LearningPath
Manual
(enrolled by a platform administrator)Membership
Purchase
Requalification
(when the course is private, has requalification enabled, and the user was granted access because they had to requalify to that course)Support
(enrolled by Workleap LMS support)
Create enrollment
curl --request POST 'https://api.didacte.com/v1/enrollments' \
--header 'X-API-Key: {{insert-api-key}}'
--header 'Content-Type: application/json' \
--data-raw '{
"enrollment": {
"user_id": 1057692,
"occurrence_id": 2536,
"notify": true
}
}'
200 OK - Returns created enrollment
{
"enrollment": {
"active": true,
"completed_at": null,
"created_at": "2022-05-04T17:45:25.325-04:00",
"enroll_method": "API",
"id": 869730,
"occurrence_id": 2536,
"updated_at": "2022-05-04T17:45:25.325-04:00",
"user_id": 1057692,
"continue_url": "http://example.didacte.com/a/course/2320/continue"
}
}
422 Unprocessable - Errors details
{
"errors": {
"user_id": [
"You cannot enroll a deactivated user"
],
"occurrence_id": [
"Already enrolled to this occurrence",
"Course is now unavailable",
"Enrollment limit is reached for this version",
"Unable to enroll outside of the registration period"
],
"course_id": [
"Already enrolled in another version or session of this course"
]
}
}
This endpoint enrolls a user to a course occurrence.
An enrollment_create
event is created when successful.
Enrollment validations
- The user cannot enroll in more than one occurrence per course
- The user account must be active
- The course must be published
- It must comply with maximum enrollment number for the occurrence (when a limit is set)
- It must comply with the occurrence registration period (if set)
Enrollment email notification
Workleap LMS sends an email notification to the user when you enroll it.
The email subject is You have been enrolled in {{course_name}}
and is sent from no-reply@didacte.com
with a reply-to set to your Workleap LMS platform contact email.
You can skip this email by setting notify
to false
.
Delete enrollment
curl --request DELETE 'https://api.didacte.com/v1/enrollments/:enrollment_id' \
--header 'X-API-Key: {{insert-api-key}}'
200 OK
{}
It should always be possible to delete an enrollment.
An enrollment_delete
event is created when successful.
List enrollments
curl --request GET 'https://api.didacte.com/v1/enrollments' \
--header 'X-API-Key: {{insert-api-key}}'
200 OK
{
"enrollments": [
{
"active": true,
"completed_at": "2017-08-24T07:32:58.861-04:00",
"created_at": "2017-04-19T10:54:29.392-04:00",
"enroll_method": "Manual",
"id": 39574,
"occurrence_id": 1550,
"updated_at": "2017-08-24T07:32:58.871-04:00",
"user_id": 22439,
"continue_url": "http://example.didacte.com/a/course/2320/continue"
},
{
"active": true,
"completed_at": null,
"created_at": "2017-04-27T14:07:47.699-04:00",
"enroll_method": "Manual",
"id": 41186,
"occurrence_id": 1550,
"updated_at": "2017-04-27T14:07:47.699-04:00",
"user_id": 23288,
"continue_url": "http://example.didacte.com/a/course/2320/continue"
}
],
"meta": {
"total_count": 2,
"total_pages": 1
}
}
Return a paginated list of all enrollments.
Pagination
The enrollments API returns up to 25 enrollments per page. You set the page with the page
param and access total count and total pages in the meta
key of the response.
Filters
Param | Type | Description |
---|---|---|
course_id | integer | Get enrollments for course |
user_id | integer | Get enrollments for user |
Ordering
There is no ordering options on this endpoint, oldest enrollments are returned first. Need something? Get in touch!
Show enrollment
curl --request GET 'https://api.didacte.com/v1/enrollments/:enrollment_id' \
--header 'X-API-Key: {{insert-api-key}}'
200 OK
{
"enrollment": {
"active": true,
"completed_at": null,
"created_at": "2022-05-04T17:45:25.325-04:00",
"enroll_method": "API",
"id": 869730,
"occurrence_id": 2536,
"updated_at": "2022-05-04T17:45:25.325-04:00",
"user_id": 1057692,
"continue_url": "http://example.didacte.com/a/course/2320/continue"
}
}
Returns the current status of that enrollment.
Learning path / Tracks
Note: Not all parts of a learning path are accessible from the public API. We provide access to the core blocks to allow enrollments.
Learning path track resource
The learning path track is the main grouping entity of the learning path. It contains multiple steps which contains multiple courses.
A user enrolled in a learning path through a learning path enrollment will have access to all courses in the learning path. However, the user may need to complete some courses before having access to courses in a later step (this information is not available in the public API at this moment).
Attribute | Type | Description |
---|---|---|
created_at | time | Learning path track creation time (read only) |
description | text | Learning path track description (may be null) |
id | integer | Learning path track identifier (read only) |
locale | string | Learning path track locale language (en , fr ) |
name | text | Learning path track name |
status | string | Learning path track status (disabled , draft , published ) |
updated_at | time | Learning path track last update time (read only) |
Attributes values
learning_path/track.status
The track can have one of those 3 status:
disabled
: The learning path track was previously published, but enrollments for it can no longer be created. Users with enrollments can still access the learning path.draft
: The learning path track is not currently accessible. Enrollments for it cannot be created and user previously enrolled cannot access the learning path track anymore.published
: The learning path track is accessible and users can be enrolled.
List learning_path/tracks
curl --request GET 'https://api.didacte.com/v1/learning_path/tracks' \
--header 'X-API-Key: {{insert-api-key}}'
200 OK
{
"learning_path_tracks": [
{
"created_at": "2023-03-13T16:37:49.727-04:00",
"description": "A new learning path for the API users",
"id": 1,
"locale": "en",
"name": "API Learning path",
"status": "published",
"updated_at": "2023-03-14T10:21:30.081-04:00"
},
{
"created_at": "2023-03-13T16:38:40.135-04:00",
"description": null,
"id": 2,
"locale": "en",
"name": "The other learning path",
"status": "draft",
"updated_at": "2023-03-13T16:38:40.135-04:00"
},
{
"created_at": "2023-03-13T16:38:59.968-04:00",
"description": null,
"id": 3,
"locale": "en",
"name": "Unavailable learning path",
"status": "disabled",
"updated_at": "2023-03-13T16:39:12.099-04:00"
}
],
"meta": {
"total_count": 3,
"total_pages": 1
}
}
Returns a paginated list of learning_path/tracks.
Pagination
The learning_path/tracks API returns up to 25 tracks per page. You set the page with the page
param and access total count and total pages in the meta
key of the response.
Filters
Param | Type | Description |
---|---|---|
ids | integer or array | Get learning_path/track with provided identifier(s) |
keyword | string | Get learning_path/track with specific search string |
status | string | Get learning_path/track with specific status (disabled , draft or published ) |
Filtering by learning_path/track keyword
The provided string will be matched against the following learning_path/track attributes:
name
description
learning_path/step.name
learning_path/step.short_description
Learning path / Enrollments
Learning path enrollment resource
A learning path enrollment is the entity that gives a user access to the content (courses) of a learning path track.
Once enrolled in a learning path track, a user will be able to enroll to all courses from that learning path.
A course enrollment will be created only when a user decides to start a course from the track.
Attribute | Type | Description |
---|---|---|
completed_at | time | Learning path enrollment completion time (null until user completes the learning_path/track - read only) |
created_at | time | Learning path enrollment creation time (read only) |
id | integer | Learning path enrollment identifier (read only) |
track_id | integer | Identifier for related learning_path/track |
track_name | string | Name of the related learning_path/track (read only) |
updated_at | time | Learning path enrollment last update time (read only) |
user_id | integer | Identifier for related enrolled user |
user_name | string | Name of the related enrolled user (read only) |
Create learning_path/enrollment
curl --request POST 'https://api.didacte.com/v1/learning_path/enrollments' \
--header 'X-API-Key: {{insert-api-key}}'
--header 'Content-Type: application/json' \
--data-raw '{
"enrollment": {
"user_id": 789,
"track_id": 1,
"notify": true
}
}'
200 OK - Returns created enrollment
{
"learning_path_enrollment": {
"completed_at": null,
"created_at": "2023-03-10T13:25:05.150-05:00",
"id": 45,
"track_id": 1,
"updated_at": "2023-03-10T13:25:05.150-05:00",
"user_id": 789,
"track_name": "My published Learning path",
"user_name": "Winston Zeddemore"
}
}
422 Unprocessable - Errors details
{
"errors": {
"track_id": [
"Already enrolled to this learning path track",
"Cannot enroll users to an unpublished learning path"
],
"user_id": [
"You cannot enroll a deactivated user"
]
}
}
This endpoint enrolls a user to a learning_path/track.
A learning_path_enrollment_create
event is created when successful.
Learning path enrollment validations
- The learning_path/track and user must be present with valid values
- The learning_path/track must be published
- The user account must be active
- The user cannot be enrolled more than once in a learning_path/track
Learning path enrollment email notification
Workleap LMS sends an email notification to the user when you enroll it to a learning_path/track.
The email subject is Enrollment to {{learning_path/track name}}
and is sent from no-reply@didacte.com
with a reply-to set to your Workleap LMS platform contact email.
You can skip this email by setting notify
to false
.
Delete learning_path/enrollment
curl --request DELETE 'https://api.didacte.com/v1/learning_path/enrollments/:enrollment_id' \
--header 'X-API-Key: {{insert-api-key}}'
200 OK
{}
It should always be possible to delete a learning_path/enrollment.
A learning_path_enrollment_delete
event is created when successful.
List learning_path/enrollments
curl --request GET 'https://api.didacte.com/v1/learning_path/enrollments' \
--header 'X-API-Key: {{insert-api-key}}'
200 OK
{
"learning_path_enrollments": [
{
"completed_at": null,
"created_at": "2023-03-14T14:25:05.150-04:00",
"id": 1,
"track_id": 1,
"updated_at": "2023-03-14T14:25:05.150-04:00",
"user_id": 2,
"track_name": "My published Learning path",
"user_name": "Egon Spengler"
},
{
"completed_at": "2023-03-14T11:37:52.000-04:00",
"created_at": "2023-03-04T13:25:05.150-05:00",
"id": 1,
"track_id": 1,
"updated_at": "2023-03-04T13:25:05.150-05:00",
"user_id": 2,
"track_name": "My published Learning path",
"user_name": "Ray Stantz"
}
],
"meta": {
"total_count": 2,
"total_pages": 1
}
}
Returns a paginated list of learning_path/enrollments.
Pagination
The learning_path/enrollments API returns up to 25 enrollments per page. You set the page with the page
param and access total count and total pages in the meta
key of the response.
Filters
Param | Type | Description |
---|---|---|
completed | boolean | Get learning_path/enrollments with completion status (true or false ) |
taxon_ids | integer or array | Get learning_path/enrollments for taxon(s) (the with_all_taxon_ids is applied here) |
track_ids | integer or array | Get learning_path/enrollments for learning_path/track(s) |
user_ids | integer or array | Get learning_path/enrollments for user(s) |
Show learning_path/enrollment
curl --request GET 'https://api.didacte.com/v1/learning_path/enrollments/:learning_path_enrollment_id' \
--header 'X-API-Key: {{insert-api-key}}'
200 OK
{
"learning_path_enrollment": {
"completed_at": "2023-03-14T11:37:52.000-04:00",
"created_at": "2023-03-04T13:25:05.150-05:00",
"id": 1,
"track_id": 1,
"updated_at": "2023-03-04T13:25:05.150-05:00",
"user_id": 2,
"track_name": "My published Learning path",
"user_name": "Ray Stantz"
}
}
Returns a single learning_path/enrollment resource.
Events
Event resource
The events endpoints allow you to search events that occurred on your Workleap LMS platform.
You can list and search events, filter them and get details for a specific event.
Events data structures
Each events are composed of 1 or more associated objects.
For example, a user_invite
event will have a user
and a committer
. The user is the target of the event action, while the committer is the person doing the action if different from the user.
Some events also have attributes directly.
Available events
Event | Object and attributes |
---|---|
attachment_download | committer, attachment, course |
author_create | api_key, committer, course, user |
author_delete | api_key, committer, course, user |
course_duplicate | committer, course, duplicate |
course_publish | committer, course |
course_sale | committer, invoice |
course_unpublish | committer, course |
email_bounce | user, to, subject, sent_at, message_id, bounce_type, bounce_sub_type |
email_complaint | user, to, subject, sent_at, message_id |
email_unbounce | user, to, subject, sent_at, message_id |
enrollment_complete | enrollment, committer, completion_snapshot |
enrollment_create | enrollment, committer |
enrollment_delete | enrollment, committer |
learning_path_enrollment_complete | committer, learning_path_enrollment, learning_path_completion_snapshot |
learning_path_enrollment_create | api_key, committer, learning_path_enrollment, user |
learning_path_enrollment_delete | api_key, committer, learning_path_enrollment, user |
learning_path_step_complete | committer, learning_path_enrollment, step_progress |
quiz_completion_failure | committer, quiz_completion, tries |
quiz_completion_success | committer, quiz_completion, tries |
review_create | committer, enrollment, course, anonymous, score |
review_update | committer, enrollment, course, anonymous, score, previous_score |
review_delete | committer, enrollment, course, anonymous, score |
requalification_expired | committer, requalification |
requalification_complete | committer, requalification |
requalification_create | committer, requalification |
requalification_period_start | committer, requalification |
supervisor_create | api_key, committer, user, group |
supervisor_delete | api_key, committer, user, group |
user_activate | api_key, committer, user |
user_deactivate | api_key, committer, user |
user_delete | api_key, committer, user |
user_import_complete | committer, user_import_id, created_users, existing_users |
user_invite | api_key, committer, user |
user_reinvite | api_key, committer, user |
user_sign_up | user, newsletter, subscribe_method, sso |
user_update | api_key, committer, user, changes |
Object attributes
Type | Attributes |
---|---|
attachment | id, name, content_type, url |
course | id, name, has_attestation, teacher, collaborators |
api_key | id, description |
enrollment | id, enroll_method, course, user, occurrence |
completion_snapshot | id, bill90_eligible, course_duration, course_name, provider_name, teacher_name, has_attestation, attestation_url, obtained_credits |
invoice | id, user, identifier, stripe_charge_id, amount, currency, type, description |
obtained_credit | quantity, reference, credit_name, credit_category_name |
user | id, name, email, locale, created_at |
learning_path_completion_snapshot | id, attestation_url, has_attestation, track_name |
learning_path_step_progress | id, completed_at, completed_courses, total_courses, step |
learning_path_step | id, name, position |
learning_path_track | id, name, has_attestation |
learning_path_enrollment | id, track, user |
occurrence | id, type, start_at, end_at, name, location, contact |
quiz_completion | enrollment, lesson_content_quiz_id, lesson_id, lesson_name, optional, quiz_result_id, score, total_points, tries |
requalification | id, starts_at, ends_at, completed_at, previous_enrollment, enrollment |
group | id, name |
List events
curl --request GET 'https://api.didacte.com/v1/events' \
--header 'X-API-Key: {{insert-api-key}}'
200 OK
{
"events": [
{
"id": "526a319c-2c0e-464b-a529-14f7b955fe45",
"type": "user_sign_up",
"data": {
"user": {
"id": 1,
"name": "John",
"email": "john@example.com",
"locale": "en",
"created_at": "2018-08-25T12:53:35.983-04:00"
},
"newsletter": true,
"method": "invite",
"sso": null
},
"created_at": "2018-05-20T14:19:21.000-04:00"
},
{
"id": "f1edbdbd-b458-41ef-989d-d4f16b910954",
"type": "user_invite",
"data": {
"committer": {
"id": 2,
"name": "Bob",
"email": "bob@example.com",
"locale": "en",
"created_at": "2018-08-25T12:27:29.183-04:00"
},
"user": {
"id": 1,
"name": "John",
"email": "john@example.com",
"locale": "en",
"created_at": "2018-08-25T12:53:35.983-04:00"
}
},
"created_at": "2018-08-25T12:53:35.000-04:00"
}
],
"meta": {
"after_offset": null,
"next_url": null,
"before_offset": null,
"prev_url": null
}
}
The events API returns a list of up to 50 events per page, with navigation offsets.
Filters
Param | Type | Description |
---|---|---|
after_offset | Integer | Get events after that offset (used for pagination) |
api_key_id | Integer | Get events generated by provided api key |
before_offset | Integer | Get events before that offset (used for pagination) |
committer_id | Integer | Get events generated by provided user (ex: when a user invites another one) |
course_id | Integer | Get events related to provided course |
enrollment_id | Integer | Get events related to provided enrollment |
occurrence_id | Integer | Get events related to provided occurrence |
related_user_id | Integer | Get events generated by or related to provided user (user_id OR committer_id ) |
track_id | Integer | Get events related to provided learning_path/track |
type | String | Get events of a specific type |
user_id | Integer | Get events related to provided user |
Show event
curl --request GET 'https://api.didacte.com/v1/events/:event_id' \
--header 'X-API-Key: {{insert-api-key}}'
200 OK
{
"id": "f1edbdbd-b458-41ef-989d-d4f16b910954",
"type": "user_invite",
"data": {
"committer": {
"id": 2,
"name": "Bob",
"email": "bob@example.com",
"locale": "en",
"created_at": "2018-08-25T12:27:29.183-04:00"
},
"user": {
"id": 1,
"name": "John",
"email": "john@example.com",
"locale": "en",
"created_at": "2018-08-25T12:53:35.983-04:00"
}
},
"created_at": "2018-08-25T12:53:35.000-04:00"
}
Returns a single event.
Events - Examples
The following event examples are only the part contained in the data
key under a full event payload.
enrollment_complete
{
"enrollment": {
"id": 779077,
"enroll_method": "LearningPath",
"course": {
"id": 22312,
"name": "Sample Course",
"has_attestation": true,
"teacher": {
"id": 910287,
"name": "Teacher Name",
"email": "teacher@example.com",
"locale": "en",
"created_at": "2020-04-24T09:10:43.172-04:00"
},
"collaborators": [
{
"id": 1090675,
"name": "Collaborator User",
"email": "collaborator@example.com",
"locale": "fr",
"created_at": "2022-01-06T11:02:02.553-05:00"
}
]
},
"user": {
"id": 1090673,
"name": "Sample User",
"email": "user@example.com",
"locale": "fr",
"created_at": "2022-01-06T11:06:02.553-05:00"
},
"occurrence": {
"id": 10518,
"type": "classroom",
"start_at": "2021-11-06T09:30:00.000-04:00",
"end_at": "2021-11-06T11:30:00.000-04:00",
"name": "Version 2019-10-23 10:34:57",
"location": "839 Saint-Joseph Est, Québec, QC G1K 3C8, Canada",
"contact": {
"id": 1090675,
"name": "Sample Collaborator",
"email": "collaborator@example.com",
"locale": "fr",
"created_at": "2022-01-06T11:02:02.553-05:00"
}
}
},
"committer": {
"id": 1090673,
"name": "Sample User",
"email": "user@example.com",
"locale": "fr",
"created_at": "2022-01-06T11:06:02.553-05:00"
},
"completion_snapshot": {
"id": 321094,
"bill90_eligible": false,
"course_duration": 420,
"course_name": "Sample Course",
"provider_name": "Sample Provider",
"teacher_name": "Sample Teacher",
"has_attestation": true,
"attestation_url": "https://account.didacte.com/attestations/b196ad2c-5f9e-43df-9e85-b541a9517b0a",
"obtained_credits": [
{
"quantity": "3.0",
"reference": "AOCF22-01-29930",
"credit_name": "Credit for Great Success",
"credit_category_name": "Association of Credits"
}
]
}
}
This event occurs when a user completes a course.
Possible values for enrollment.enroll_method
The attestation found under completion_snapshot.attestation_url
is the completion certificate PDF that can be downloaded without authentication.
enrollment_create
{
"enrollment": {
"id": 759233,
"enroll_method": "Free",
"course": {
"id": 320,
"name": "Sample name",
"has_attestation": false,
"teacher": "Teacher Name",
"collaborators": [
{
"id": 1090675,
"name": "Collaborator User",
"email": "collaborator@example.com",
"locale": "fr",
"created_at": "2022-01-06T11:02:02.553-05:00"
}
]
},
"user": {
"id": 1080676,
"name": "Sample User",
"email": "user@example.com",
"locale": "fr",
"created_at": "2021-12-02T08:55:01.847-05:00"
},
"occurrence": {
"id": 230,
"type": "classroom",
"start_at": "2021-11-06T09:30:00.000-04:00",
"end_at": "2021-11-06T11:30:00.000-04:00",
"name": "Version 2019-10-23 10:34:57",
"location": "839 Saint-Joseph Est, Québec, QC G1K 3C8, Canada",
"contact": {
"id": 1090675,
"name": "Collaborator User",
"email": "collaborator@example.com",
"locale": "fr",
"created_at": "2022-01-06T11:02:02.553-05:00"
}
}
},
"committer": {
"id": 1080676,
"name": "Sample user",
"email": "user@example.com",
"locale": "fr",
"created_at": "2021-12-02T08:55:01.847-05:00"
}
}
This event occurs when a user enroll (or is enrolled) in a course.
Possible values for enrollment.enroll_method
learning_path_enrollment_create
{
"api_key": {
"id": 1,
"description": "API Test key"
},
"committer": null,
"learning_path_enrollment": {
"id": 37,
"track": {
"id": 1,
"name": "My published Learning path",
"has_attestation": false
},
"user": {
"id": 789,
"name": "Winston Zeddemore",
"email": "winston@ghostbusters.com",
"locale": "en",
"created_at": "2023-03-10T16:16:07.802-05:00"
}
}
}
This event occurs when a user is enrolled in a learning_path/track.
Either api_key
or committer
will be filled depending on how the enrollment was created.
learning_path_enrollment_delete
{
"api_key": {
"id": 1,
"description": "API Test key"
},
"committer": null,
"learning_path_enrollment": {
"id": 37,
"track": {
"id": 1,
"name": "My published Learning path",
"has_attestation": false
},
"user": {
"id": 789,
"name": "Winston Zeddemore",
"email": "winston@ghostbusters.com",
"locale": "en",
"created_at": "2023-03-10T16:16:07.802-05:00"
}
}
}
This event occurs when a learning_path/enrollment is deleted.
Either api_key
or committer
will be filled depending on the deletion method used.
quiz_completion_failure
{
"committer": {
"id": 976500,
"name": "Admin User",
"email": "admin@example.com",
"locale": "en",
"created_at": "2020-12-12T12:10:08.501-05:00",
},
"quiz_completion": {
"enrollment": {
"id": 759233,
"enroll_method": "Free",
"course": {
"id": 320,
"name": "Sample name",
"has_attestation": false,
"teacher": "Teacher Name",
"collaborators": [
{
"id": 1090675,
"name": "Collaborator User",
"email": "collaborator@example.com",
"locale": "fr",
"created_at": "2022-01-06T11:02:02.553-05:00"
}
]
},
"user": {
"id": 976500,
"name": "Admin User",
"email": "admin@example.com",
"locale": "en",
"created_at": "2021-12-02T08:55:01.847-05:00"
},
"occurrence": {
"id": 230,
"type": "classroom",
"start_at": "2021-11-06T09:30:00.000-04:00",
"end_at": "2021-11-06T11:30:00.000-04:00",
"name": "Version 2019-10-23 10:34:57",
"location": "839 Saint-Joseph Est, Québec, QC G1K 3C8, Canada",
"contact": {
"id": 1090675,
"name": "Collaborator User",
"email": "collaborator@example.com",
"locale": "fr",
"created_at": "2022-01-06T11:02:02.553-05:00"
}
}
},
"lesson_content_quiz_id": 17,
"lesson_id": 51,
"lesson_name": "Lesson 1",
"optional": false,
"quiz_result_id": 38,
"score": 0,
"total_points": 1,
"tries": 0
}
}
This event occurs when a user fails a quiz.
quiz_completion_success
{
"committer": {
"id": 976500,
"name": "Admin User",
"email": "admin@example.com",
"locale": "en",
"created_at": "2020-12-12T12:10:08.501-06:00",
},
"quiz_completion": {
"enrollment": {
"id": 759233,
"enroll_method": "Free",
"course": {
"id": 320,
"name": "Sample name",
"has_attestation": false,
"teacher": "Teacher Name",
"collaborators": [
{
"id": 1090675,
"name": "Collaborator User",
"email": "collaborator@example.com",
"locale": "fr",
"created_at": "2022-01-06T11:02:02.553-05:00"
}
]
},
"user": {
"id": 976500,
"name": "Admin User",
"email": "admin@example.com",
"locale": "en",
"created_at": "2021-12-02T08:55:01.847-05:00"
},
"occurrence": {
"id": 230,
"type": "classroom",
"start_at": "2021-11-06T09:30:00.000-04:00",
"end_at": "2021-11-06T11:30:00.000-04:00",
"name": "Version 2019-10-23 10:34:57",
"location": "839 Saint-Joseph Est, Québec, QC G1K 3C8, Canada",
"contact": {
"id": 1090675,
"name": "Collaborator User",
"email": "collaborator@example.com",
"locale": "fr",
"created_at": "2022-01-06T11:02:02.553-05:00"
}
}
},
"lesson_content_quiz_id": 17,
"lesson_id": 52,
"lesson_name": "Lesson 2",
"optional": false,
"quiz_result_id": 38,
"score": 2,
"total_points": 2,
"tries": 0
}
}
This event occurs when a user completes a quiz successfully.
user_invite
Invited from the interface by an administrator
{
"api_key": null,
"committer": {
"id": 976500,
"name": "Admin User",
"email": "admin@example.com",
"locale": "en",
"created_at": "2020-12-12T12:10:08.501-05:00"
},
"user": {
"id": 1090674,
"name": "Sample User",
"email": "user@example.com",
"locale": "en",
"created_at": "2022-01-06T11:07:26.116-05:00"
}
}
Invited via an API call
{
"api_key": {
"id": 203,
"description": "My first API key"
},
"committer": null,
"user": {
"id": 1090674,
"name": "Sample User",
"email": "user@example.com",
"locale": "en",
"created_at": "2022-01-06T11:07:26.116-05:00"
}
}
This event occurs when a user is invited.
user_sign_up
{
"user": {
"id": 1090673,
"name": "Sample User",
"email": "user@example.com",
"locale": "fr",
"created_at": "2022-01-06T11:06:02.553-05:00"
},
"newsletter": true,
"subscribe_method": "signup_form",
"sso": "jwt"
}
This event occurs when a user account creation is completed.
When you invite a user, this event occurs only when the user chooses his password and confirms his account (after the user_invite
event, which occurs when the invitation is created).
Possible values for subscribe_method
:
signup_form
(created by user itself)invite
(user was invited to a platform)sso
(created automatically via SSO login)
Hooks
The Hooks endpoint allows you to register web hooks that will be called when specific events happen in Workleap LMS.
For every event, we will POST to the given url with an application/json
body containing the event.
The JSON body format is exactly the same you get on the Show event endpoint.
Notes:
- The user-agent of our client is
didacte/webhook
- If you return a
410 Gone
status, the hook will delete itself - In case of error, we will retry progressively and with an exponential delay for up to 3 weeks
Hook resource
A hook can be set up for a single event or all events by not setting a specific type.
See available event types under the event endpoints.
Attribute | Type | Description |
---|---|---|
url | string | URL where you want to receive events (https required) |
event | string | Limit to a specific event (leave empty to receive all) |
active | boolean | Do you really want to receive events? |
List hooks
curl --request GET 'https://api.didacte.com/v1/hooks' \
--header 'X-API-Key: {{insert-api-key}}' \
200 OK - Returns hook
{
"hooks": [
{
"id": 53,
"url": "https://example.com",
"event": "user_invite",
"active": true
}
]
}
Lists existing hooks and their statuses.
This list endpoint is not paginated.
Create hook
curl --request POST 'https://api.didacte.com/v1/hooks' \
--header 'X-API-Key: {{insert-api-key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"hook": {
"event": "user_invite",
"url": "https://example.org/receive/webhook/here"
}
}'
200 OK - Returns the newly created hook.
{
"hook": {
"id": 554,
"url": "https://example.org/receive/webhook/here",
"event": "user_invite",
"active": true
}
}
Creates a new hook where Workleap LMS will send events.
Delete hook
curl --request DELETE 'https://api.didacte.com/v1/hooks/555' \
--header 'X-API-Key: {{insert-api-key}}'
200 OK - Hook was deleted
{}
Deletes the webhook.
Errors
The Workleap LMS API uses the following error codes:
Code | Meaning |
---|---|
400 | Bad Request -- Your request is invalid. |
401 | Unauthorized -- Your API key is wrong. |
403 | Forbidden -- The action is not permitted for this API key. |
404 | Not Found -- The specified record could not be found. |
422 | Unprocessable -- Check response body for error attribute errors |
429 | Too Many Requests -- You're requesting too many things! Slow down! |
500 | Internal Server Error -- We had a problem with our server. Try again later. |
503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later. |
Changelog
2023-11-07
- Added documentation for
quiz_completion_failure
andquiz_completion_success
events.
2023-06-27
- Removed support for Dutch language.
2023-06-01
- Added documentation for all
authors
endpoints and events.
2023-03-22
- Added documentation for
learning_path/enrollments
create and delete endpoints.
2023-03-14
- Added documentation for
learning_path/tracks
index endpoint. - Added documentation for
learning_path/enrollments
index and show endpoints.
2022-09-21
- Added documentation for
course_sale
anduser_delete
events. - Specified more attributes that may return a null value.
2022-06-25
- Added documentation for
courses
,occurrences
,providers
andsyllabuses
endpoints. - Various documentation improvements (normalization, reordering, links between sections, etc.) that do not affect API features.
2022-06-03
- Attributes
course_duration
andbill90_eligible
were added to thecompletion_snapshot
object in events
2022-05-30
- The enrollments endpoints were added
2021-12-21
- The users endpoints were added
EnrollmentDelete
event was added
2021-11-18
UserImportComplete
event was added
2021-07-09
ReviewCreate
ReviewUpdate
andReviewDelete
events were added
2021-05-31
CourseDuplicate
event was added