Skip to main content

In my instance we use a lot of groups. Our groups break down into several areas; groups for our vendors (to isolate external companies), groups for our internal organizations, and lastly ad hoc groups created by admins and power users for reporting. Due to a recent re-org I needed to create a lot of groups, and this is how I accomplished it in Postman. 

If you haven’t done so, take the time to go through at least the first two of @Bfarkas Virtual Workshops

https://community.docebo.com/events?tab=past&type=Virtual%20Workshop

This will give you a basic understanding of the API and Postman. Many thanks to Brian Farkas on his hard work and everything that he shared that made this so much simpler.

I had already created groups manually that matched what I needed. In the API explorer I then pulled list of audiences to get the UUID of one of the groups that matched what I needed to make. For this I used the GET /audiences/v1/audience endpoint.

Then I used the UUID from my target audience to get the details about that specific audience using the GET /audiences/v1/audience/{uuid} endpoint.

I then worked in the API explorer to create an audience (group) using the Put /audiences/v1/audience endpoint. Once I had tested that I moved into Postman.

In the example below the audience is based on branch membership (“branch_id”: 1) and a user additional field (“field”: “16”) which houses the organizational unit information. 

I standardized the name, and description of the branches, using a variable for the organizational unit info

  • Audience name = organizational unit name
  • Description = Automatic group - Org Unit = {Org_Unit_Name} + Branch Name
{
"name": "{{Org_Unit_Name}} (Org)",
"description": "Automatic group - Org Unit= {{Org_Unit_Name}} + Internal",
"type": "automatic",
"exclude_deactivated_users": true,
"ruleset": {
"status": "READY",
"operator": "AND",
"sets": "
{
"rules_operator": "AND",
"rules": ,
{
"type": "BranchMembership",
"payload": {
"branch_ids":
1
],
"branch_ids_descendants": r
{
"branch_id": 1,
"descendants": false
}
]
}
},
{
"type": "UserAdditionalField",
"payload": {
"field": "16",
"predicate": {
"text":
"{{Org_Unit_Name}}"
],
"operator": "equal"
}
}
}
]
}
]
}
}

As described by @Bfarkas in the Virtual Events, I used a variable in the body of the request {{Org_Unit_Name}}.

I then setup a csv file with Org_Unit_Name as the top row, and then each of the values for each my organizational units on each row below that.

As Brian demonstrated, all of these values (header and variables) have to match up to be successful.

In Postman I then right click on the folder that holds my new Create Audience - Org Unit endpoint and select Run Folder. Then I select the csv file with the values (here you can see it named Org.Unit.Names.csv). 

Right click on the folder and select Run Folder

 

Uncheck endpoints you do not want to run, select your file and then select the Run Docebo APIs for Sharing button (so named because I used Brians templates as a starting point). Your button may be different.

The process runs, and then you have your groups.

I went from creating one group in the interface every 3 minutes or so, to creating one group every minute in the API browser using copy & paste from Notepad ++ to creating 60 groups in 1 minute.

😍GREAT work @dwilburn !


Incredible collaboration @dwilburn & @Bfarkas! Wonderful to see your solution and payload illustrated above!

Bookmarked! 😉


Thank you for sharing this! 

After reading posts here like this one and watching the recordings by Bfarkas, I have been able to make my first Postman collections and calls.  Thank you both!

 

Situation: I created a Postman POST call to create groups ({{Sandbox_Base_URL}}/audiences/v1/audience) and used a runner to reference a CSV that fed in different dates for a hire date range. After some tweaking everything worked! I was able to validate that groups were created in our Sandbox with the criteria needed ...except no users met the criteria of the group.

This was not true. I had configured a test user to meet the criteria.

I went in and re-confirmed the criteria settings and resaved the group, and then the test user showed as a member of the group.

Initially I thought it was an issue in the body in Postman related to descendants within one of our top branches, so I removed that part from the body completely.  However, even after re-running the runner and re-creating the group, the criteria still showed correctly in the UI for the group (less the criteria I removed in the body), but the user didn’t appear until I re-confirmed the criteria for the group and re-saved the group.

 

Question:

Is there something in the body of the call that is needed to ‘push’ the refresh so learners actually are added to the group?  Is there an expected time frame where groups automatically refresh and I just need to wait for that time to elapse before thinking there is something wrong with my call?

 

Thank you for any insight you can share! I truly appreciate it!

 


Hi ​@Elaine_Barnes I did not run into that. Unfortunately I was laid off and I am trying to find another Docebo job, so I do not have access to a system to test.

You are doing a great job on this!

The content I posted had worked at the time, adding users to the groups. It may be something simple like a missing comma. I suggest starting with a very simple group and get that to work. 

The other way to go at this is to use the API to “pull” the info on your audience that worked. Evaluate the pull to see if there is something that was missed and do some more testing. Maybe you will see something that catches your eye.

You could use GET /audiences/v1/audience or GET /audiences/v1/audience/{uuid} to pull your existing audience. I believe if you do a GET on all then you can get the UUID.

I look forward to hearing how it works.


Reply