API & Webhooks

API Browser Quick Grabs: Bulk Update Course Information

  • 10 February 2023
  • 17 replies
  • 641 views

Userlevel 7
Badge +3

This guide is the second in a new series of new guides brought to you by @Bfarkas. Links to his other API Browser Quick Grabs guides can be found at the end of this article.

 

I frequently hear that admins need to update their naming conventions, add information to courses, and more—and that they end up doing this manually. While there are unsupported ways to use the automation app, many hope for a simple way to upload a CSV file. I cannot offer that, but there is a single endpoint in the API Browser that allows you to update the Course Code, Title, Description, Language, Status, and Thumbnail for a group of courses. If you can format the information, you can easily update courses without needing to know much about actual APIs.

 

Important Note: The API endpoint we will be using is a PUT, meaning it will update and change information on your system. It is highly recommended to test on a sandbox environment to make sure you are ok with the changes you are making first.

 

 

Filling in Course Information

  1. Open the Excel or Google Sheets file below. (They work the same but are available in different formats for preference or compatible programs on work computers)

    • Access ‘API-BulkUpdateCourseInfo_CreateJSON’ on Google Sheets and make your own copy.

    • Download ‘API-BulkUpdateCourseInfo_CreateJSON’ for Excel by downloading the file attached at the end of this guide.

 

  1. On the first tab (Course_Info_Input) of the spreadsheet, there is a table of 100 rows. This is the table you will use to fill in the information on the courses you wish to update:

     

 

  1. For each course you wish to update, fill the following information into a row:
    • Row Index: Ignore this field and leave the value that is pre-populated. If you have an error during the update, this will come in handy when identifying which course is having the issue.
    • Course ID: (REQUIRED FIELD) This is the only required field that MUST be populated. If a value is not entered here, the row will be ignored completely. This is the unique Docebo ID for the course found from running reports or in the URL when on the course page:

       

    • Course Code: This field has a limit of 50 characters. If you put in a longer string, it will not update the course and you will receive an error.
    • Title: This field has a limit of 255 characters. If you put in a longer string, it will not update the course and you will receive an error.
    • Description: If you want to enter any styles or “fancy” elements, they must be entered as HTML code. Any style entered using excel format will be ignored.
    • Language: This is the shortcode of a language that is supported in your instance, for example en=English, es=Spanish. The easiest way to find these values is to look in the Localization Tool:

       

    • Status: Only accepted values are Blank (which leaves the existing status as is), Published, or Under Maintenance.
    • Thumbnail: This is the unique Docebo ID of the thumbnail image. The easiest way to find this is to upload your image to another course and then use the API Browser to look up that course's information. (You can use the ‘View a Course info’ Under Course > Courses in the API Browser) It can be useful to keep a chart of your common images so you can put them in easily. Scroll down the ‘Response Body’ to find the thumbnail ID:

Note: You only need to fill in cells you wish to update the data on. If the current value should stay the same you can either fill it in or leave the cell blank.

 

  1. Repeat the process filling in a row for each course you wish to update:

     

 

  1. Once you have entered all your changes, or filled the full 100 rows, switch to the ‘Output’ tab on the bottom of the sheet. You should see rows of the information you have put in formatted properly into the JSON format the API endpoint is looking for:

     

 

  1. Select all the cells in column A that have visible content in them and copy them to your clipboard:

     

 

 

Making the Batch Course Update

If you are not familiar with the API Browser, I encourage you to check out the overview provided in this article.

  1. Log into your Docebo instances API Browser by going to: https://<yoursubdomain.docebosaas.com>/api-browser/ 

     

 

  1. On the ‘Services’ menu select ‘Course’.

     

 

  1. Scroll down the left side to find and select the ‘Courses’ category.

 

  1. Select the ‘Batch Course Update’ option.

     

 

  1. Paste the content from the ‘Output’ tab in Excel/Google Sheets into the ‘Body’ box:

     

 

  1. Select the ‘OAUTH’ button underneath the options and sign in if you have not done so already.

     

 

  1. Select the ‘Try’ button.

     

 

  1. The request and response should open in the middle of your screen:
     

     

Note: Depending upon how many courses you are updating at one time, it may take a minute or two to process, be patient and watch the ‘Try’ button as it will show ’Loading…’.

 

  1. Review the responses to make sure all rows were processed successfully. The above image has two being processed, indicated by both having a ‘success: true’ state.

    If a row has an error, this will show as ‘false’ and provide a message to explain what is wrong. If this happens, use the Row Index to find the line item in the Excel/Google Sheet to fix the error. In the below example the second row has an error due to an incorrect language value as I put ‘English’ instead of ‘en’. In this example, the first course was updated but the second was not:

     

 

  1. Repeat the process if you have more than 100 courses to manage/update

Tip: If you are going to use regularly and have more than 100 courses, just save the current information into versions of the file so you can just make tweaks and then run the update call.

 

That’s it, you just updated 100 courses details with one API call! Go get a job well done snack with your free time.

 

More API Browser Quick Grabs:

Listing Groups

Listing Locations

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 Create Power Users

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!


17 replies

Userlevel 5
Badge +1

Is there any API to support batch updating "Course Additional fields”?

Userlevel 7
Badge +3

You have to do individual updates and loop through them for those I believe.

Userlevel 5

@Bfarkas -- you are amazing!

To follow up on @Baskaran venugopal’s question, I was just looking to do that very thing myself. I need to update a Course Additional Field on a whole category of courses, and I was hoping to use the API browser to do it.

Here is an example of what I need:

 

FOR EACH course in the “LinkedIn Learning Content” category

SET value of field “Content Creator/Vendor” to “LinkedIn Learning”

 

I was just looking the PUT command for learn/course/update a course additional field, but my coding experience is so out of date that I’m not sure how to word a commend to get what I want.

Would anyone with more experience than me in APIs be willing to show me how to accomplish this goal? Pretty, pretty please? And thank you so very much!

 

 

Userlevel 3
Badge

Hey! I think you can’t update course additional fields (the ones I assume you created?) with our API. 😕

Hello !

I tried to update multiple additional fields with the Batch Course Update, with no luck.

This request :

{
    "items": [{
            "id": 109,
            "description": "XXX",
            "additional_fields": {
                "3": "AAAA",
                "6": "BBBB",
                "7": "CCCC",
                "8": "DDDD",
                "9": "FFFFF"
            }
        },
        {
            "id": 108,
            "description": "XXXX",
            "additional_fields": {
                "3": "AAAAA",
                "6": "BBBBB",
                "7": "CCCC",
                "8": "DDDD",
                "9": "FFFF"
            }
        }
    ]
}

Is valid, but only the description field is actualy updated. A very similar code works in Update specific Course, but you’ll need to update every course individualy.

Userlevel 7
Badge +3

Hello !

I tried to update multiple additional fields with the Batch Course Update, with no luck.

This request :

{
    "items": [{
            "id": 109,
            "description": "XXX",
            "additional_fields": {
                "3": "AAAA",
                "6": "BBBB",
                "7": "CCCC",
                "8": "DDDD",
                "9": "FFFFF"
            }
        },
        {
            "id": 108,
            "description": "XXXX",
            "additional_fields": {
                "3": "AAAAA",
                "6": "BBBBB",
                "7": "CCCC",
                "8": "DDDD",
                "9": "FFFF"
            }
        }
    ]
}

Is valid, but only the description field is actualy updated. A very similar code works in Update specific Course, but you’ll need to update every course individualy.

Correct, for additional fields you have to do one by one. Preferably you can program at that point and loop it, but thats why it was ignored for the scope of this series.

Userlevel 5

Well, bummer! 

Userlevel 7
Badge +3

Well, bummer! 

its on the list of things for the next Fark.tools, basically let you upload your csv and it will process the loop for you. More soon.

Userlevel 5

Thanks, @Bfarkas!

Docebo, for future reference, here are a few other Course fields I’ve wished I could update in bulk, set defaults for, or have imported via marketplace integrations, particularly LinkedIn Learning:

  • SKILLS
  • Average Time
  • Self-Unenrollment
  • Player Background Image
  • Course Widgets
  • Catalogs
  • Channels
Userlevel 1

Anyone knows if there’s a similar option for updating training material descriptions (the one under ‘additional info’)? 

Userlevel 1

Anyone knows if there’s a similar option for updating training material descriptions (the one under ‘additional info’)? 

@Bfarkas any chance you’ve investigated this already? Thanks 🙏

Userlevel 7
Badge +3

Anyone knows if there’s a similar option for updating training material descriptions (the one under ‘additional info’)? 

@Bfarkas any chance you’ve investigated this already? Thanks 🙏

Hey @sebas , unfortunately I have not investigated. I also have not come across endpoints casually in browsing around the API Browser, will add to the investigation list though.

Userlevel 1

Well, bummer! 

its on the list of things for the next Fark.tools, basically let you upload your csv and it will process the loop for you. More soon.

Hello @Bfarkas, there is any update about this topic? I have the same need today regarding updating the additional fields for many courses and it would be so annoying to have to modify the courses one by one.. Thank you

Userlevel 7
Badge +3

Well, bummer! 

its on the list of things for the next Fark.tools, basically let you upload your csv and it will process the loop for you. More soon.

Hello @Bfarkas, there is any update about this topic? I have the same need today regarding updating the additional fields for many courses and it would be so annoying to have to modify the courses one by one.. Thank you

Nothing new to report other than it is still on the list to be worked on soon, I reprioritized based on active user feedback some of the tools since that post.

Userlevel 1

Thank you @Bfarkas ! Hoping for good news soon 

Userlevel 4

Adding to this discussion as another client who could really the additional field for batch update in Docebo. Hope we get this soon!

Thank you @Bfarkas ! Hoping for good news soon 

 

Userlevel 2
Badge

Adding in my voice as something I could *really* use. Thanks!

Reply