After the Community Coaching Session: Using Postman

  • 11 January 2024
  • 43 replies
  • 429 views

Userlevel 7
Badge +4

The second Community Coaching session has come and gone, and so many came to learn how to use Postman with their Docebo instance. Thank you all for setting the time aside, these sessions are only great when you show up :)

As promised, to help you get up and going a tad quicker in Postman, I made a Collection to share with security preconfigured, and many common API’s loaded and ready to use. It is a great starter library to use as your getting more comfortable using the program.

 

The JSON file is attached to this post as a zipped file. Download, extract, and use the steps below to import it into your Postman. 

Note: I had to break this post up a bit into the comments below, please look through for appropriate steps.


43 replies

Userlevel 7
Badge +4

How To Import the Collection into Postman

  1. Navigate to or create a new Workspace you wish to load this collection into.

     

  2. On the ‘Collections’ tab, select the ‘Import’ button towards the top:

     

  3. Either drag and drop, or navigate to the JSON file you downloaded from this post and select it onto the modal that opens:

     

  4. Make sure the import completes, look towards the bottom of the screen for a status. Sometimes with the newer file format, it fails the first time, just try again and it should work.
Userlevel 7
Badge +4

Setting Up Authentication

 

Great, you have successfully imported the collection, in order to use it, make sure to finish configuring the Authorization tab and generate a token. To do that follow these steps:

  1. Select the top level of the Collection ‘Docebo API for Sharing’.
  2. Switch to the ‘Authorization’ tab:

     

  3. Scroll down and fill in the ‘Client ID’ and ‘Client Secret’ fields using the information from your Docebo instance. If you do not know how to get these/configure them, see the next section below.
  4. Make sure to select ‘Save’ in the top right:

     

  5. To help this template be more flexible, we used variables for the base URL throughout, including the Authorization area. You need to enter your domain into that variable. To do this, switch to the ‘Variables’ tab:

     

  6. Enter your domain into the ‘Initial Value’ and ‘Current Value’ box next to the ‘base_url’ variable:

     

  7. Make sure to click ‘Save’ in the top right corner.
  8. Return to the ‘Authorization’ tab.
  9. Now it is time to generate a token, select the ‘Get New Access Token’ button.
  10. Log in if you are not already, if you are select Authorize to proceed:

     

  11. Select ‘Use Token’:

     

  12. Make sure ‘Auto-Refresh’ is toggled on, it should automatically do so:

     

  13. That’s it, you are set to go and run API calls throughout this collection.

 

Userlevel 7
Badge +4

Setting Up OAuth2.0 App in Docebo

If you have not setup an OAuth2.0 app in your Docebo Instance and are not sure how, follow these steps before completing the previous section:

  1. Log in to your Docebo instance and navigate to the ‘API and SSO’ area of the System Admin menu.
  2. Switch to the ‘API Credentials’ tab:

     

  3. Select ‘Add OAuth2 App’
  4. Fill in the following information:
    1. App Name: Give it a meaningful name to let other System Administrators know what the purpose of this app is.
    2. App Description: Add more meaning and specifics here for your fellow System Administrators.
    3. Client ID: Create a unique and meaningful name, this should not be easily guessed. This is one of the pieces of data you will need in postman.
    4. Client Secret: This will be generated automatically, but you will need this value in postman.
    5. Redirect URL: Put the following: https://www.getpostman.com/oauth2/callback

       
  5. Select ‘Confirm’ when done, and make sure the green checkmark is on for it to be active.
  6. Return to Postman and enter the Client ID and Client Secret.
Userlevel 7
Badge +7

You are da man.

Userlevel 7
Badge +6

@Bfarkas  You are such a gift to the community, and possibly to the world. Thank you SOOOO much for your time/effort. I hope somebody is buying you a lot of root beer.

Userlevel 7
Badge +6

@Bfarkas Ran into a issue getting the authorization to work. I think I understand what the issue was

  1. My company has a teams version of Postman which is based in the browser, not the download app. While I created a person free account (cause I just like to be a non-conformist), I didn’t catch that the authentication happens IN THE BROWSER even if I have the app installed.
  2. The callback URL was different in the browser, so when I tried to get the token I got a callback error.
  3. I signed out of my free account from the browser, and went back to the app. Once I got logged into the desktop app correctly, the callback URL in the Authorization tab matched the one you list in the OAuth2 section of this tutorial. AND I got my token 😁

Just thought I would note that in case anyone else runs in to challenges.

Userlevel 7
Badge +4

@KMallette great troubleshooting! I tend to avoid the browser based one, as it historically was limited, which I know is no longer true, will need to dig into that myself and get comfy too!

Userlevel 7
Badge +4

@Bfarkas  You are such a gift to the community, and possibly to the world. Thank you SOOOO much for your time/effort. I hope somebody is buying you a lot of root beer.

Glad you enjoyed! Now that we have covered the tools, we are going to start moving through some practical use cases….aka the real fun :)

Userlevel 5
Badge +1

@Bfarkas Hmmm… I’m getting an error. 

{"error":"redirect_uri_mismatch","error_description":"The redirect URI provided is missing or does not match","error_uri":"http:\/\/tools.ietf.org\/html\/rfc6749#section-3.1.2"}

Did I miss a step where I have to update the redirect URL?

 

Userlevel 5
Badge +1

Now that I see reference to it, I’m working in the web version… going to go try the desktop version now.

Userlevel 7
Badge +4

@JKolodner are you using the browser version by chance? Sounds similar to what @KMallette ran into above if so?

Userlevel 7
Badge +4

Ha, we crossed paths posting, sounds good! I am working on an updated instructions for using the web browser one, more soon. 

Userlevel 5
Badge +1

@Bfarkas It worked with the desktop version. Thanks so much!

Userlevel 5
Badge +1

@Bfarkas Also for your updated instrux, remind folks not to include the final slash when entering their domain in the variable fields.

Userlevel 5
Badge +1

@Bfarkas I do believe I have made a successful GET call from:

Services: Skill>Skill>Retrieve the entire skills list

I generated the call in Docebo’s API browser, then took the URL that was generated and I put it into Postman. The results appear to include the first 20 skills only (likely the default for Page 1, which I cannot appear to change).

  1. How do I see all 860 skills that should be in this report?
  2. How do I convert the results into something viewable/sharable with others?
  3. Let’s say tomorrow a new skill is added. How do I refresh the list?

I feel like I’m missing some crucial parts of how I can get data out of the system in a useable way. BTW, my company does not permit use of Google products, so please don’t suggest that.

 

Thank you so much!

With your help, I am off and running!

Userlevel 5
Badge +1

I have been using this for assistance, too: 

 

Userlevel 7
Badge +4

 Hey @JKolodner So, just to confirm are you using the api GET - /skill/v1/skills/catalog ?

For the first question, even though the API Browser doesn’t say it does, it supports two parameters that are pretty common around the API, page and page_size. You can add thes ein postman, and increase the size of the page, this may not get you all the way to your amount though as there is often an upper limit. You then generally have to page through the results to collect them all. What I often do is look for newly added in this case, sort by desc :)

Anyways, on the param tab of your call add two new keys, page, page_size and for value page starts at 1, and page_size, see how large it will let you, my sandbox only has 150 so I can’t try. YOur setup should look similar:

 

If you scroll to the bottom of the results, there is a section that will tell you how many results, page size, which page you are on, etc. :
 

 

Userlevel 7
Badge +4

Ok, for part two, there are a LOT of ways you can go, kind of comes down to your specifics, and also preferences.

There are JSON to CSV converters out there, many on the web which work by simply copy and paste, like this one: https://www.convertcsv.com/json-to-csv.htm

There are also some folks out there who have written ways to save out a csv from postman, they can get involved or tricky, have not found one I am comfortable just saying to use, but if you are interested, they are out there for sure.

The other route you can do with Excel (and not supported in Google, so you win there :) ), is save JSON output to a file, there is an option for this on the top right menu of the response box:

 

In excel, you can treat this as a data source.

Open an excel document, and on the data tab, look for ‘Get Data’ > ‘From File’ > ‘From JSON’
 

 

Navigate and select the JSON file.

It is going to establish a data connection to this file. This is the key here, it is worth this initial setup, as if you save the results from postman later over the same file, your excel will refresh and read the new data.
 

 

Click the ‘Record’ next to Data to expand it to see the below:


Select the ‘List’ next to items, to expand it again, to see the below:

Select ‘To Table’ in the top left, if a modal opens, just click OK.

Select the two arrows at the top of the ‘records’ column to see the detail options to add to the table, I would leave them all checked and click ok:
 

Select ‘Close and Load’ in the top left and your table will be loaded:

 

Now, pro tip, right click the query on the right side of the screen, you can select its properties and there should be an option to ‘refresh on file open’. This means it will recheck the JSON file for what data to load in the table automatically, so if you overwrite the JSON file, next time you open here, it will auto-refresh. 

Userlevel 7
Badge +4

Now continuing I can almost hear your next question @JKolodner , but I only connected one file and Docebo API is making me page it out….annoying right?

Well, here’s a nice thing, you can repeat the excel process again, inside the same excel, with multiple JSON’s. On that query/connection panel on the right, if you right click one of them, there is an option to ‘Merge’. SO you could put all the pieces together and merge them into one giant table within excel, and then you would just need to add new files.

Userlevel 7
Badge +4

All of this being said, my actual question usually becomes, what task are you trying to perform by gathering all of the skill information? What do others actually need to see and use?

Userlevel 5
Badge +1

@Bfarkas - Thanks so much for all of that. I’m going through it slowly now, but it is making sense (a tribute to you!). I am using this as a first, very accessible example, since there was already a Community post saying you could do it in APIs. We have implemented skills and I’m interested in other calls that look like things that I’m currently having to do manually, such as: Return Users That Have A Specific Associated Skill, Return Content That Has A Specific Associated Skill, Retrieve The Skills Associated To Skill Groups. This was a good place to start.

Userlevel 7
Badge +4

@Bfarkas - Thanks so much for all of that. I’m going through it slowly now, but it is making sense (a tribute to you!). I am using this as a first, very accessible example, since there was already a Community post saying you could do it in APIs. We have implemented skills and I’m interested in other calls that look like things that I’m currently having to do manually, such as: Return Users That Have A Specific Associated Skill, Return Content That Has A Specific Associated Skill, Retrieve The Skills Associated To Skill Groups. This was a good place to start.

Makes sense, and you can completely manage the skills via API, was a fairly quick build out as a tool over at Fark.Tools as well for folks just looking to load and download and such, but always love folks digging in and learning these skills. The above ‘connect to data from excel’ is one of my favorite tricks for CSV files too which let you do a one time setup of dashaboards/analysis and then just replace the underlying files. There are a few examples of this as well as using the API for report type things in this article as well:

 

Userlevel 5
Badge +1

This is really great. I’ll be digging into it all!

Userlevel 1

Hello @Bfarkas, first of all I wanna thank you for all the work you provided. I followed the last session yesterday and it was very clear and very explained and helpful!! so thank you again!

I have some questions.

  • I’m trying to returns the list of SCORM interactions with an GET call:  /learn/v1/lo/scorminteraction/{scorm_id}/list - But I don’t know where can I get the scorm_id, do you have any idea? 
  • It seems to me that this refers to the interaction of a single user, but is there a call to have the interactions of all those who responded and in non-anonymous way?

Thank you so much for your help

Userlevel 7
Badge +4

Hi @RokiaB ,

So I don’t live in scorms that much any more but took a quick look. The sco id is the item_id of the learning object in this case. Theres a post for how to get this form the front end if you want(or depending on how the scorm is set up) here:

Or if you want to from the API, looks like the easiest from a quick look is to use the ‘Get all learning objects by course ID’. It is under the learn service > Course:

The output should tell you type and there should be a line called ‘item_id’ which is what you want:
 

 

In terms of your second part, yes this is one user per object, quick look not seeing a better option, but will scan some more and see, or maybe someone else will see this and have an idea :)

Reply