This guide is the third in a new series of new guides brought to you by
When it comes to managing the locations for in person classes, there is a nice way to upload new locations in bulk. If you want a listing of all current locations in the system, however, you are stuck to paginated front end UI. Fortunately, there is a simple API call to get you this information. This is a GET endpoint meaning you are simply viewing the information and will not cause any changes to the system.
Listing Locations
-
Access your Docebo instance’s API Browser by going to: https://<yoursubdomain.docebosaas.com>/api-browser/
-
On the ‘Services’ menu select ‘learn’ if it is not already selected.
-
Scroll down the left side to find and select the ‘Location’ category.
-
Select the ‘Returns list of Locations’ option.
-
There are 4 fields in the center area to be aware of:
-
sort_attr: This sets which piece of data about each location is used to sort the order of the list. By default (leaving the field blank) this will be the unique Docebo ID assigned to the location. If you prefer to sort differently you can enter ‘name’ into this field.
-
sort_dir: You can set the order of the attribute you selected in the previous field to be ascending or descending. By default (leaving the field blank) it will be descending, if you want it to be ascending put ‘asc’ in the field.
-
page_size: This endpoint can produce very long lists. To avoid performance issues, it will make pages of results. This lets you set how many items show up on a page. By default it is 10 items. The maximum size is 200 items. Enter an appropriate number for your needs here.
-
page: As mentioned above, this endpoint can produce very long lists. To avoid performance issues, it will make pages of results. This field lets you choose which of those pages you view in the output. For example, if you have 50 locations and the page size is set to 20, 3 pages will be generated. When you initially run the endpoint, you will see items 1-20. If you put a 2 in this field, you will then get items 21-40. Put a 3 in this field to get 41-60.
-
-
Enter the appropriate information in the fields described above.
-
Select the ‘OAUTH’ button underneath the options and sign in if you have not done so already.
-
Select the ‘Try’ button.
-
The request and response should open in the middle of your screen:
-
The information about the locations will be found in the ‘Response Body’ box. If you are comfortable reading or using JSON formatted data, you can simply use this box as is—you are done! If you want this data in a table format, keep reading.
-
Copy all the information in the ‘Response Body’ box to your clipboard.
-
Navigate to https://www.convertcsv.com/json-to-csv.htm
-
Under ‘Step 1’ use the ‘Enter Data’ tab and paste the Response Body information into the box:
-
Scroll down to ‘Step 3’. You will see a preview of your data as a comma separated block (which can be copied to your clipboard if you want) as well as a table.
-
There are two buttons to download your results, one as a CSV (Download Result) and one as an Excel file (JSON To Excel). Select either or both of these to download.
Tip: Change the name in the ‘Save your result’ box to your preference prior to downloading. This will be the file name of both the CSV and the Excel file you download.
- Open your file and manage away!
That’s it! You now have a nice file with all your current location information. Easily sort, verify, and update the information using it. That wasn’t so bad, right? Enjoy!
More API Browser Quick Grabs:
Bulk Update Course information
Bulk Unenroll Users from Courses or Learning Plans
Bulk Update User’s Enrollment to a Completion
Bulk Enroll and Mark User Complete in a Course
Bulk Remove Power User Level from Users
How do you use the API Browser? Are there any endpoints you don’t understand or use cases you’re looking for input on? Comment below!