### Example Payload for Search Started Source: https://developer.docebo.com/docs/embedded-learning-building-blocks-my-courses-and-learning-plans-widget An example payload for the 'search_started' event, showing a search for 'course1' initiated by 'player1'. ```javascript { search: 'course1', emitter: 'player1' } ``` -------------------------------- ### Example Playback Started Event Payload Source: https://developer.docebo.com/docs/embedded-learning-building-blocks-course-player-widget An example payload for the `playback_started` event, showing the training material ID and course name. ```javascript { trainingMaterialId: '89', name: 'Course Example', emitter: 'player1' } ``` -------------------------------- ### Example GET Request with Authorization Header Source: https://developer.docebo.com/docs/api-general-information This cURL command demonstrates how to make a GET request to the 'manage' API, including the necessary Authorization header. ```shell curl -i -X GET http://yourdomain.docebo.com/manage/v1/group -H 'Authorization: Bearer f7bfc5f78877f6ec321a650b10e8aa3d32a18f32' ``` -------------------------------- ### Search Started Example Payload Source: https://developer.docebo.com/docs/embedded-learning-building-blocks-course-list-widget An example of the payload data when a search operation starts, showing a specific course name and emitter ID. ```typescript { search:'course name', emitter: 'courseListId' } ``` -------------------------------- ### Example API Call Source: https://developer.docebo.com/docs/api-general-information This example demonstrates how to make a GET request to the /manage/v1/group endpoint using curl, including the necessary authorization header. ```APIDOC ## GET /manage/v1/group ### Description Retrieves a list of groups. ### Method GET ### Endpoint `/manage/v1/group` ### Request Example ```shell curl -i -X GET http://yourdomain.docebosaas.com/manage/v1/group -H 'Authorization: Bearer f7bfc5f78877f6ec321a650b10e8aa3d32a18f32' ``` ### Response #### Success Response (200) - **Content-Type** (string) - application/json; charset=UTF-8 - **X-Docebo-Api-Version** (string) - The version of the API. #### Response Example ```http HTTP/1.1 200 OK Server: openresty Date: Tue, 29 May 2018 08:35:06 GMT Content-Type: application/json; charset=UTF-8 Content-Length: 479 Connection: keep-alive Access-Control-Allow-Credentials: true Access-Control-Expose-Headers: X-Docebo-Api-Version X-Docebo-Api-Version: 1.0.0 X-UA-Compatible: IE=Edge,chrome=1 X-Frame-Option: SAMEORIGIN X-XSS-Protection: 1 Access-Control-Allow-Origin: * X-Docebo-Backyard: manage Front-End-Https: on ``` ``` -------------------------------- ### Example Session Link Generation Source: https://developer.docebo.com/docs/connect-recipes An example demonstrating how to construct a full session link using provided parameters and the defined URL structure. ```http https://platform.example.com/learn/course/190/session/54/example-session ``` -------------------------------- ### Example API Call Source: https://developer.docebo.com/v1/docs/api-general-information This snippet demonstrates how to construct a full API request URL and includes an example using curl. ```APIDOC ## Example API Call ### Description This example shows how to form a complete API request URL by combining the base URL with an endpoint path. It also provides a `curl` command for making a GET request to the `/manage/v1/group` endpoint. ### Method GET ### Endpoint `/manage/v1/group` ### Request Example ```shell curl -i -X GET http://yourdomain.docebo.com/manage/v1/group -H 'Authorization: Bearer f7bfc5f78877f6ec321a650b10e8aa3d32a18f32' ``` ### Response Example ```http HTTP/1.1 200 OK Server: openresty Date: Tue, 29 May 2018 08:35:06 GMT Content-Type: application/json; charset=UTF-8 Content-Length: 479 Connection: keep-alive Access-Control-Allow-Credentials: true Access-Control-Expose-Headers: X-Docebo-Api-Version X-Docebo-Api-Version: 1.0.0 X-UA-Compatible: IE=Edge,chrome=1 X-Frame-Option: SAMEORIGIN X-XSS-Protection: 1 Access-Control-Allow-Origin: * X-Docebo-Backyard: manage Front-End-Https: on ``` ``` -------------------------------- ### Authentication Response Example Source: https://developer.docebo.com/docs/apis-authentication This is an example of a successful response from the authentication endpoint, containing the access token and its details. ```json { "access_token": "87b567fa3de672fb3adef9492b294bb83f8cd266", "expires_in": 3600, "token_type": "Bearer", "scope": "api" } ``` -------------------------------- ### Example: Authenticating API Call with Curl Source: https://developer.docebo.com/docs/apis-authentication This example demonstrates how to use curl to make a GET request to a Docebo API endpoint, including the Authorization header with a Bearer token. ```shell curl -X GET https:///learn/v1/courses \ -H 'Authorization: Bearer 2af6ac532cfef197b00f69639aeeef86621d1975' ``` -------------------------------- ### Learning Plan Loaded Example Payload Source: https://developer.docebo.com/v1/docs/embedded-learning-building-blocks-course-list-widget An example payload for the 'lp_course_list_loaded' event, showing loaded courses within a learning plan. ```typescript { [ { id: 181, name: "Course With Video", type: "elearning" }, { id: 221, name: "Course C2", type: "elearning" } ] emitter: 'courseListId' } ``` -------------------------------- ### Example Payload for Item List Loaded Source: https://developer.docebo.com/docs/embedded-learning-building-blocks-my-courses-and-learning-plans-widget An example payload for the 'item_list_loaded' event, showing a list containing two e-learning courses. ```javascript { items:[ { id: '181', name: 'Course with video', type: 'elearning' }, { id: '182', name: 'Other course with video', type: 'elearning' } ], emitter: 'player1' } ``` -------------------------------- ### Example Payload for Item Selected Source: https://developer.docebo.com/docs/embedded-learning-building-blocks-my-courses-and-learning-plans-widget An example payload for the 'item_selected' event, demonstrating the details of a selected e-learning course. ```javascript { id: '181', name: 'Course with video', type: 'elearning', emitter: 'myclp' } ``` -------------------------------- ### Example React Application for Embedded Learning Source: https://developer.docebo.com/docs/embedded-learning-for-react-web-applications This example application demonstrates how to conditionally render embedded learning content within a React application. It shows how to import and use the `EmbeddedLearningModule` and `ExampleComponent`. ```javascript import EmbeddedLearningModule from "./EmbeddedLearningModule"; import ExampleComponent from "./ExampleComponent"; import {useState} from "react"; function App() { const [page, setPage] = useState('a'); return ( <>
{page === 'a' &&

This is page A, embedded learning is only on page B

} {page === 'b' && <>

This page contains embedded learning

} ); } export default App; ``` -------------------------------- ### Learning Plan Course List Loaded Example Payload Source: https://developer.docebo.com/docs/embedded-learning-building-blocks-course-list-widget An example payload for the 'lp_course_list_loaded' event, showing a list of courses within a learning plan and the emitter ID. ```typescript { [ { id: 181, name: "Course With Video", type: "elearning" }, { id: 221, name: "Course C2", type: "elearning" } ] emitter: 'courseListId' } ``` -------------------------------- ### Authenticate and Start Docebo Kernel (New Command) Source: https://developer.docebo.com/docs/embedded-learning-building-blocks-1 This JavaScript code initializes the kernel and starts the widget population process. Replace 'https://myplatform.com' with your platform's domain and specify your preferred language. ```javascript ``` -------------------------------- ### General CSP Configuration for Embedded Learning Source: https://developer.docebo.com/docs/configuring-your-site-content-security-policy-for-embedded-learning Add these sources to your existing CSP directives to allow Embedded Learning launcher and Building Blocks. Replace 'integrator.example.com' with your actual integrator domain. ```csp Content-Security-Policy: script-src integrator.example.com https://*.dcbstatic.com https://*.docebosaas.com 'self'; style-src integrator.example.com https://*.dcbstatic.com 'unsafe-inline' 'self'; img-src integrator.example.com https://*.dcbstatic.com https://*.docebosaas.com 'self'; frame-src *.dcbstatic.net; child-src *.dcbstatic.net; connect-src https://*.docebosaas.com 'self'; ``` -------------------------------- ### Background Job Execution Started Event Payload Source: https://developer.docebo.com/docs/webhooks-events Example payload for the `bj.execution.started` event. Triggers when the execution of a background job has started. ```json { "webhook_id": 27, "original_domain": "example.exampledomain.com", "event": "bj.execution.started", "fired_by_batch_action": false, "message_id": "wh-20290821-144303-d93a044b-7fa8-4020-83f5-c31c12ebf71c", "payload": { "fired_at": "2025-08-21 14:42:49", "job_hash": "1fdb26fce5c533800f243ed9cd5b072288f1d3c4", "extra_data": null } } ``` -------------------------------- ### Initialize and Connect to Docebo Kernel Source: https://developer.docebo.com/v1/docs/embedded-learning-mobile-sdk This snippet shows how to create a global kernel instance and connect to the Docebo platform. The `connect` function is designed to be called from native code when the webview opens, parsing connection options and starting the kernel. ```javascript // Create a global instance of the kernel const DFlowKernel = DSDK.kernel(); // This function will be invoked from the native code as soon as the webview opens function connect(options) { const { domain, accessToken, language, context } = JSON.parse(options); DFlowKernel.setTokenProvider(renewToken); DFlowKernel.start({ domain: domain, context: context, language: language, }) } ``` -------------------------------- ### Initialize and Start Docebo Kernel with Token Provider Source: https://developer.docebo.com/v1/docs/embedded-learning-building-blocks-1 This JavaScript code initializes the Docebo kernel and sets up a token provider for authentication. It starts the kernel with the platform domain and preferred language. This is the recommended approach. ```javascript ``` -------------------------------- ### GET /learn/v1/enrollments Source: https://developer.docebo.com/v1/docs/deprecated-and-changed-api-calls Retrieves user enrollments. The enrollment status now returns 'Not Started', 'In Progress', or 'Completed' instead of 'null' when all courses in a learning plan are suspended. ```APIDOC ## GET /learn/v1/enrollments ### Description Retrieves user enrollments. The enrollment status now returns 'Not Started', 'In Progress', or 'Completed' instead of 'null' when all courses in a learning plan are suspended. ### Method GET ### Endpoint /learn/v1/enrollments ### Response #### Success Response (200) - **enrollment_status** (string) - The status of the enrollment, which can be 'Not Started', 'In Progress', 'Completed', or 'Suspended'. ``` -------------------------------- ### Initialize Embedded Learning Launcher Source: https://developer.docebo.com/v1/docs/embedded-learning-mobile-sdk Creates a global instance of the launcher and defines a `connect` function to be called from the native app. This function parses options, sets the token provider, and starts the launcher. ```javascript // Create a global instance of the launcher const DFlowLauncher = DFlow.launcher(); // This function will be invoked from the native code as soon as the webview opens function connect(options) { const { domain, accessToken, language, launcherCode } = JSON.parse(options); DFlowLauncher.setTokenProvider(renewToken); DFlowLauncher.start({ domain, launcherCode, language, }) .then(DFlowLauncher.open); // Open the launcher as soon as the launcher is ready } ``` -------------------------------- ### Start Docebo Kernel with Domain Only (Deprecated) Source: https://developer.docebo.com/v1/docs/embedded-learning-building-blocks-1 This is a deprecated method for starting the Docebo kernel, accepting only the platform domain. It is advised to update to the newer method that includes language and token provider configuration. ```javascript ``` -------------------------------- ### Get Started with the Docebo API Browser Source: https://developer.docebo.com/llms.txt Access the Docebo API browser to explore interactive documentation, authenticate, and test API calls on your platform's data effortlessly. ```APIDOC ## Get Started with the Docebo API Browser ### Description Access the Docebo API browser to explore interactive documentation, authenticate, and test API calls on your platform's data effortlessly. ### Usage Navigate to the API browser within your Docebo platform to begin exploring and testing API endpoints. ``` -------------------------------- ### GET Endpoint with Secondary Identifier for Organization Chart Source: https://developer.docebo.com/docs/api-general-information This example shows how to retrieve organization chart details using a branch code instead of a unique ID. The `use_secondary_identifier=true` query parameter must be set. ```HTTP https://yourdomain.docebosaas.com/manage/v1/orgchart/code1562?use_secondary_identifier=true ``` -------------------------------- ### Create WebView Screen in Android Source: https://developer.docebo.com/docs/embedded-learning-for-android Set up a basic Android screen that hosts a WebView component. This screen will be used to display the embedded learning content. ```kotlin fun WebViewScreen() { var webView: WebView? = null AndroidView(factory = { WebView(it).apply { // We will place the necessary code to handle the two way communication here } }, update = { webView = it }) } ``` -------------------------------- ### Create WebView Screen Source: https://developer.docebo.com/v1/docs/embedded-learning-for-android Set up a Composable function to display a WebView, which will host the embedded learning content. ```kotlin fun WebViewScreen() { var webView: WebView? = null AndroidView(factory = { WebView(it).apply { // We will place the necessary code to handle the two way communication here } }, update = { webView = it }) } ``` -------------------------------- ### Retrieve Course IDs with Bash and jq Source: https://developer.docebo.com/docs/api-essentials-retrieving-ids This script uses `curl` to make a GET request to the Docebo courses endpoint and `jq` to parse the JSON response, extracting and printing course IDs and names. Ensure `curl` and `jq` are installed in your environment. ```shell #!/bin/bash # Configuration variables DOMAIN=".docebosaas.com" TOKEN="YOUR_ACCESS_TOKEN" # Perform the GET request to the courses endpoint # We use -s (silent) to hide the progress bar curl -s -X GET "https://$DOMAIN/learn/v1/courses" \ -H "Authorization: Bearer $TOKEN" \ -H "Accept: application/json" | jq -r '.data.items[] | "ID: \(.id_course) | Name: \(.course_name)"' # EXPLANATION: # .data.items[] iterates through the list of courses # \(.id_course) extracts the specific ID needed for enrollments or updates ``` -------------------------------- ### Example React Application with Embedded Learning Source: https://developer.docebo.com/v1/docs/embedded-learning-for-react-web-applications This example application integrates the EmbeddedLearningModule and ExampleComponent to provide embedded learning functionality. Ensure the imported modules are in the same directory or adjust the import paths accordingly. ```javascript import EmbeddedLearningModule from "./EmbeddedLearningModule"; import ExampleComponent from "./ExampleComponent"; import {useState} from "react"; function App() { const [page, setPage] = useState('a'); return ( <>
{page === 'a' &&

This is page A, embedded learning is only on page B

} {page === 'b' && <>

This page contains embedded learning

} ); } export default App; ``` -------------------------------- ### GET /learn/v1/enrollments Source: https://developer.docebo.com/docs/deprecated-and-changed-api-calls Retrieves user enrollments. Similar to the learning plan endpoint, if a user's enrollment status is 'Suspended' across all courses within a learning plan, the system now returns 'Not Started', 'In Progress', or 'Completed' instead of `null` for the enrollment status. ```APIDOC ## GET /learn/v1/enrollments ### Description Retrieves user enrollments. If a user's enrollment status is 'Suspended' in all courses of a learning plan, the returned enrollment status will now be 'Not Started', 'In Progress', or 'Completed' instead of `null`. ### Method GET ### Endpoint /learn/v1/enrollments ### Response #### Success Response (200) - **enrollment_status** (string) - The enrollment status, which can now be 'Not Started', 'In Progress', or 'Completed' even if individual course statuses are 'Suspended'. ``` -------------------------------- ### GET /learningplan/v1/learningplans/enrollments Source: https://developer.docebo.com/docs/deprecated-and-changed-api-calls Retrieves enrollment statuses for learning plans. Previously, if all courses within a learning plan had a 'Suspended' status, the enrollment status was returned as null. This has been updated to return 'Not Started', 'In Progress', or 'Completed' based on the individual course enrollment statuses. ```APIDOC ## GET /learningplan/v1/learningplans/enrollments ### Description Retrieves enrollment statuses for learning plans. If a user's enrollment status is 'Suspended' in all courses of a learning plan, the returned enrollment status will now be 'Not Started', 'In Progress', or 'Completed' instead of `null`. ### Method GET ### Endpoint /learningplan/v1/learningplans/enrollments ### Response #### Success Response (200) - **enrollment_status** (string) - The enrollment status of the learning plan, which can now be 'Not Started', 'In Progress', or 'Completed' even if individual course statuses are 'Suspended'. ``` -------------------------------- ### Changed API Calls - February 2024 (User Response Country) Source: https://developer.docebo.com/docs/deprecated-and-changed-api-calls The `country` parameter is no longer included in the response for GET `/manage/v1/user/{user_id}`. For GET `/manage/v1/user/search` and GET `/manage/v1/user`, country names are now localized. ```APIDOC ## Changed API Calls - February 2024 ### User Response Country Field **Description**: For `GET /manage/v1/user/{user_id}`, the `country` parameter is no longer returned in the response. It can still be accessed as an additional field. For `GET /manage/v1/user/search` and `GET /manage/v1/user`, the country names returned as user additional fields are now localized based on the API caller's language. ``` -------------------------------- ### Example Warning Shown Payload Source: https://developer.docebo.com/docs/embedded-learning-building-blocks-course-player-widget An example payload for the 'warning_shown' event, specifically illustrating a 'training_material_error' type. ```javascript { type: 'training_material_error', emitter: 'player1' } ``` -------------------------------- ### Initialize Embedded Learning Launcher Source: https://developer.docebo.com/docs/embedded-learning-for-react-native After the WebView loads the page, initialize the Docebo launcher by calling the 'connect' function with configuration options. Ensure options are stringified for injection. ```typescript const onLoadEnd = () => { // domain: the Docebo platform domain // accessToken: the initial access token; this is optional, but providing it will improve the startup time. If not passed, the web page will call the onMessage function and obtain a new token. // launcherCode: the app launcher code const options = JSON.stringify({ domain: '', accessToken: '', launcherCode: '', context: '', language: '', }); // It's not advides to pass objects throught the javascript injection. Instead we serialize the // options and parse it on the receiving side webView.current?.injectJavaScript(`connect('${options}')`); } ``` -------------------------------- ### Play Training Material Command Source: https://developer.docebo.com/v1/docs/embedded-learning-building-blocks-course-player-widget Send this command to the widget to load and play the current training material. If it's a video, playback will start automatically. The promise resolves with a 'playing: true' payload. ```javascript DSDK.getCommandBus().send( 'play', 'ID OF WIDGET', {} ) ``` ```javascript { playing: true } ``` -------------------------------- ### Chained API Call Example (Bash) Source: https://developer.docebo.com/v1/docs/api-essentials-retrieving-ids A bash script demonstrating how to first retrieve a catalog ID using the preview endpoint and then use that ID to fetch the full details of the specific catalog. ```APIDOC ## Bash Script for Chained Catalog Retrieval ### Description This script first calls the `preview` endpoint to get a list of catalogs, extracts the ID of the first catalog found, and then uses that ID to request the full details of that specific catalog. It includes error checking to ensure a catalog ID was successfully retrieved before proceeding. ### Usage 1. Replace `` with your actual Docebo platform URL. 2. Replace `YOUR_ACCESS_TOKEN` with your valid OAuth2 token. 3. Ensure `curl` and `jq` are installed in your environment. ### Script Breakdown 1. **Define Variables**: Sets the `DOMAIN` and `TOKEN` for authentication. 2. **List Call**: Executes a GET request to `/learn/v1/catalog_content/internal/preview?page_size=1` to fetch catalog data. 3. **Extract ID**: Uses `jq` to parse the JSON response and extract the `id_catalog` from the first item. 4. **Error Checking**: Verifies if a `CATALOG_ID` was successfully extracted. 5. **Detail Call**: Executes a GET request to `/learn/v1/catalog_content/internal/{catalog_id}` using the extracted ID to retrieve detailed catalog information. ### Example Code ```shell #!/bin/bash # DEFINE YOUR VARIABLES DOMAIN=".docebosaas.com" TOKEN="YOUR_ACCESS_TOKEN" echo "Checking for available catalogs..." # THE FIRST API CALL (The "List" Call) LIST_RESPONSE=$(curl -s -X GET "https://$DOMAIN/learn/v1/catalog_content/internal/preview?page_size=1" \ -H "Authorization: Bearer $TOKEN" \ -H "Accept: application/json") # EXTRACT THE ID CATALOG_ID=$(echo $LIST_RESPONSE | jq -r '.data.items[0].extra_data.id_catalog') # ERROR CHECKING if [ "$CATALOG_ID" == "null" ] || [ -z "$CATALOG_ID" ]; then echo "Error: No catalog was found in the response." exit 1 fi echo "Successfully found Catalog ID: $CATALOG_ID" echo "Fetching full details for this catalog..." # THE SECOND API CALL (The "Detail" Call) curl -s -X GET "https://$DOMAIN/learn/v1/catalog_content/internal/$CATALOG_ID" \ -H "Authorization: Bearer $TOKEN" \ -H "Accept: application/json" | jq . ``` ``` -------------------------------- ### Example Volume Level Changed Event Payload Source: https://developer.docebo.com/docs/embedded-learning-building-blocks-course-player-widget An example payload for the `volume_level_changed` event, showing a volume level of 80. ```javascript { level: 80, emitter: 'player1' } ``` -------------------------------- ### Select Previous Training Material Command Source: https://developer.docebo.com/v1/docs/embedded-learning-building-blocks-course-player-widget Moves the course pointer to the previous available training material. This command has no effect if there is no previous material. The promise resolves with 'success: true' if accepted, otherwise 'success: false'. ```javascript DSDK.getCommandBus().send( 'select_prev_tm', 'ID OF WIDGET', {} ) ``` ```javascript { success: true | false } ``` -------------------------------- ### WebView Setup for Docebo Embedded Learning Source: https://developer.docebo.com/docs/embedded-learning-for-android This Kotlin code sets up a WebView to load a Docebo learning page. It configures the WebViewClient to inject JavaScript for connecting and handling token renewal messages. ```kotlin // WebViewScreen.kt const val MESSAGE_HANDLER_IDENTIFIER = "doceboFlowMessageHandler" const val RENEW_TOKEN_MESSAGE_IDENTIFIER = "RENEW_ACCESS_TOKEN" const val WEBPAGE_URL = "" fun WebViewScreen(accessToken: String, launcherCode: String, context: String, language: String, domain: String) { var webView: WebView? = null AndroidView(factory = { WebView(it).apply { val launcherOptions = LauncherOptions( accessToken = accessToken, launcherCode = launcherCode, context = context, language = language, domain = domain, ) val launcherOptionsJson = Gson().toJson(launcherOptions) webViewClient = object : WebViewClient() { override fun onPageFinished(view: WebView?, url: String?) { super.onPageFinished(view, url) val userScript = "const requestAccessToken = () => window.${MESSAGE_HANDLER_IDENTIFIER}.postMessage('${RENEW_TOKEN_MESSAGE_IDENTIFIER}'); connect('${launcherOptionsJson}');" evaluateJavascript(userScript, null) } } addJavascriptInterface( AndroidNativeInterface(this), MESSAGE_HANDLER_IDENTIFIER ) loadUrl(WEBPAGE_URL) webView = this } }, update = { webView = it }) } ``` -------------------------------- ### Training Material Loaded Example Payload Source: https://developer.docebo.com/docs/embedded-learning-building-blocks-course-list-widget An example payload for the 'training_material_loaded' event, showing the emitter type, which can be 'internal-course-player' or 'external-course-player'. ```typescript { emitter: external-course-player } ``` -------------------------------- ### Warning Shown Example Payload Source: https://developer.docebo.com/docs/embedded-learning-building-blocks-course-list-widget An example payload for the 'warning_shown' event, specifying the type of warning (e.g., 'no_result_search') and the emitter. ```typescript { type: 'no_result_search', emitter: 'player1' } ``` -------------------------------- ### Select Next Training Material Command Source: https://developer.docebo.com/v1/docs/embedded-learning-building-blocks-course-player-widget Moves the course pointer to the next available training material. This command has no effect if there is no further material. The promise resolves with 'success: true' if accepted, otherwise 'success: false'. ```javascript DSDK.getCommandBus().send( 'select_next_tm', 'ID OF WIDGET', {} ) ``` ```javascript { success: true | false } ``` -------------------------------- ### Example Payload for Search Ended Source: https://developer.docebo.com/docs/embedded-learning-building-blocks-my-courses-and-learning-plans-widget An example payload for the 'search_ended' event, showing a search for 'test' that returned one result. ```javascript { search: 'test', isEmpty: false, result: [ { id: '1', name: 'test', type: 'elearning' } ], emitter: 'player1' } ```