Introduction
This article walks you through how to make different kinds of API requests using the Docebo API browser, including calls with required parameters and those with body parameters.
For an overview of how to browse the different services and endpoints once you are in the API browser, see the article Overview of API browser services and endpoints.
Authentication
Before you can start making API calls you will need to access the API browser at https://<your platform URL>/api-browser/
and authenticate. This process is described more in detail in the article Get started with the Docebo API browser.
There are two main ways in which you can authenticate:
Method 1: Log in to the platform first, and then open the API browser in another tab. This is advisable if you log in using an SSO method.
Method 2: Another option for authentication is to enter your credentials directly into the API browser.
Once you have authenticated, in the API browser you will see that the Oauth button changes to Signout.
Before authentication | Authentication successful |
Please note: Irrespective of how you authenticate, the actions you can perform via the API browser will be constrained by the permissions of your platform account. If you are a Power User, you may not be able to make certain calls or access certain resources.
API without required parameters
Some APIs do not require parameters to be launched. To try your first API call, it is easiest to choose one that does not require you to provide any parameters. You should also select a GET
call as these only retrieve data, so there is no risk of unwanted changes. Here is an example of how to do this:
Check if parameters are required
Once you have identified the service and endpoint, you can check whether parameters are required. If the field blanks do not have the “required” placeholder, the API can be launched without inputting any data.
In this example, we are going to use the API endpoint to retrieve information on all courses, Returns all courses: get/learn/v1/courses.
Launch the endpoint:
Once you have authenticated, you can scroll down below the parameters and under Test this endpoint click the TRY button. The response should be displayed according to the schema in the default JSON format.
API with required parameters
In this second example, we will look at an API endpoint with a required parameter. For the endpoint to work as expected, a parameter has to be included in the request to obtain the expected response.
Check what parameters are required:
When a parameter is required, the API browser documentation will indicate it to us with a placeholder, as shown below.
In this example, we are going to use the API endpoint to retrieve information on a single course, View a course: get/learn/v1/courses/{course_id}.
On the API browser we can see that we need to enter a numeric value, the course_id
.
Find the value of the required parameter:
To find the required parameter, a second API or the platform URLs can help us identify it.
Looking at this example, we need the course ID. This can be obtained in two ways:
- The course ID can be found directly on the platform. If you already know the name of the course, look for it on the platform and retrieve the ID from the URL.
- If, on the other hand, you need to retrieve several IDs at once, using a second API could be helpful. In this case, we can leverage the API of the preceding example (Returns all courses: get/learn/v1/courses). The response to the Returns all courses endpoint shows the course ID.
Tip: Reports can also help us retrieve course and users IDs. For more information on how to retrieve IDs see the article on retrieving IDs For extra details on how to recover IDs directly from the Docebo platform interface, this Community Article can be helpful
Launch the endpoint
Provided you have authenticated, after entering the required parameters you can click click the TRY button, then the response should be displayed according to the schema in the default JSON format.
API with body parameter
In the API browser, some endpoints require you to include a body with your request. The body is where you provide the data that will be sent to the server, such as creating or updating information. Below is a quick guide on how to try an endpoint that requires a body in the API browser.
Copy the body sample
To help you input a body parameter you can use the body sample, visible on the right side of the screen. Clicking on it will automatically copy the sample into the body text field.
Editing the body
After the body sample is added, you will need to replace the placeholder text (values in quotation marks, on the right hand side of each key:value
pair) with your own data. For example, if the sample shows "name": "string"
, you would replace "string"
with the actual name you want to input.
→ If the box for the body is too small, you can expand it by clicking and dragging the corner.
Understand what data to input
If you’re unsure about what data to include, check the body schema section. This will show you the expected types of values (e.g., string, number) and indicate which fields are required for the request to succeed.
Launch the endpoint
After filling in all the required values in the body, authenticate as needed, and you’re ready to launch the endpoint. This will send your request to the server with the provided data.