Pulling data from ALL surveys using the API

  • 15 October 2021
  • 34 replies
  • 2029 views


Show first post

34 replies

Userlevel 6
Badge +1

If any of you are using Integromat/Make for automating things with the API, I’m happy to share my blueprint/solution for this built with the logic supplied by @alekwo .  

 

Hat tip to @alekwo for the underlying logic for this solution built mostly on Integromat/Make (make.com). You could build something similar with PowerAutomate or Docebo Connect.

 

This particular workflow is kicked off using a Mailhook generated from a PowerApp. That PowerApp is a Docebo Admin Panel that I’ve been working on for a while.  Eventually I’ll switch this to a webhook or just run the Make automation on a schedule.

Explanation of steps:

  1. The Mailhook kicks off everything.  There’s a filter between this step and the next to ensure the email came from the right place.
  2. An OAuth2 connection is made to the Docebo APi to find out how many pages are going to be retrieved.
  3. A repeater is set to the “total_page_count” returned by Docebo.
  4. an OAuth2 request is made to the Docebo API to loop through each page get all the Learning Objects (LO’s)/Training materials.
  5. In iterator looks at each LO, and a filter only sends on the “poll” type LOs for further processing.
  6. An request is made to the LMS itself to initiate a Poll Result Export.
  7. Another request is made to the LMS itself to download the Excel version of the file.
  8. Some text parsing will occur to rename the file to match a naming convention.
  9. The file is uploaded to SharePoint/OneDrive for further processing.

The downloaded files are then handled through other means to create instructor-specific versions and placed into access-controlled folders.  This part is handled through some VBA code currently,

Attached is a sanitized blueprint.json file that can be used with Make to re-create the workflow there. Remove the .txt extension before using.

Userlevel 4

The bigger issue, at least for me, is this endpoint only returns the first 100 results. There is no provisioning in the endpoint to change the page and page size like many of them have. As a result I can only get the first 100 results.

GET /learn/v1/survey/{pollId}/answer?id_course={courseId}

 

Userlevel 7
Badge +3

The bigger issue, at least for me, is this endpoint only returns the first 100 results. There is no provisioning in the endpoint to change the page and page size like many of them have. As a result I can only get the first 100 results.

GET /learn/v1/survey/{pollId}/answer?id_course={courseId}

 

Have you tried adding on the page and page size like in others? I have encountered this a few times and although not documented, they worked. I don’t have a survey to test on for you though.

Userlevel 4

@Bfarkas, thanks, no I have not. Here is what the API browser shows. I also opened a ticket with Docebo. They are going to investigate further and get back to me.

I will try it next week.

 

Userlevel 7
Badge +3

Yeah, I’d give it a shot, if you have a tool outside of the api browser, just take them onto the end of the url as variables like you normally would. Literallly just ran into this with the skills endpoint and it worked. 

Userlevel 4

Yeah, I’d give it a shot, if you have a tool outside of the api browser, just take them onto the end of the url as variables like you normally would. Literallly just ran into this with the skills endpoint and it worked. 

Thanks @Bfarkas, I confirmed this works.

Userlevel 7
Badge +3

Excellent, good to know! Thanks for circling back to confirm.

Userlevel 4

@Bfarkas or others, what happens when you exceed the 1000 API calls per hour? Do you get a notification or do things just quit working?

I have been working on this and instead of doing all of this via API calls, I dumped a course report (CSV) and imported that to get much of the data, reducing the needed calls.

We have only two surveys, one for ILT and one for e-Learning, so I can hard code the query to course ID and the associated ID of the poll.

At that point all I have to do is loop on the survey pull for each course ID based on how many pages of survey results there are. I will further reduce the calls by having one pull for the ILTs and one for the e-Learnings.

But I am unsure of how to estimate when I will get to 1000 calls. We have 374 e-Learnings and 46 ILTs. But I will probably be ok as long as I split the two up.

Any advice is appreciated.

Userlevel 7
Badge +3

@Bfarkas or others, what happens when you exceed the 1000 API calls per hour? Do you get a notification or do things just quit working?

I have been working on this and instead of doing all of this via API calls, I dumped a course report (CSV) and imported that to get much of the data, reducing the needed calls.

We have only two surveys, one for ILT and one for e-Learning, so I can hard code the query to course ID and the associated ID of the poll.

At that point all I have to do is loop on the survey pull for each course ID based on how many pages of survey results there are. I will further reduce the calls by having one pull for the ILTs and one for the e-Learnings.

But I am unsure of how to estimate when I will get to 1000 calls. We have 374 e-Learnings and 46 ILTs. But I will probably be ok as long as I split the two up.

Any advice is appreciated.

Yup, that is my biggest concern with this method. You did some solid mitigations that I would also recommend in your use case, nice job. In terms of the limit, it is a soft limit, so it won’t stop you if you go over, but just know support can’t help you if you are going significantly over and begin experiencing issues.

Reply