I’m working on a requirement to create a report to fetch the active certifications from the endpoint. The issue that i’m having is that I’m unable to fetch all of the active certifications from the endpoint. Is there a way to filter only on the active certifications and retrieve all of the results. Below is my logic, I also tried adding a sorter based on date due and it pulls the completed certifications in the results. Is there a way to achieve this?
The filters query param will enable you pull only the certifications in the ACTIVE phase. With the limit and offset parameters defined above you will receive back records 0-249. If you have more than 250 active campaigns you would have to call the api a second time with a new offset, the below api call will get the records from 250-499.
The count query parameter you included indicates whether a total count will be returned, factoring in any filter parameters, in the X-Total-Count response header. The value will be the total size of the collection that would be returned if limit and offset were ignored. For example, if the total number of results is 1000, then count=true would return 1000 in the X-Total-Count header. Since requesting a total count can have performance impact, it is recommended not to send count=true if no use is being made of that value.
Thank you. I executed the first API call and was able to fetch 25 active certifications out of 44. When I executed the second API call it only returned 4 certifications not sure why it did not return the rest. Can you advise.
This looks like your initial API call, but then @tyler_mairose provided some examples that use the filtering your were looking for. Did you try the filter? What were the two API calls that you mentioned executing?
I tried executing the following API calls as suggested by Tyler. The first API call returns 25 active certifications out of 44. If I’m understanding correctly the first API call should have returned all the active certifications since the 250 limit is not exceeded.
If you run the second request without the filter, just the limit and offset, do you only see those 4 active certifications, or do you see other certifications as well?
It returned 5 certifications from the past which were already completed. Here’s the breakdown: Currently, we have 42 Active certifications, and 67 certifications that were completed in the past totaling 109.
This is strange behavior for pagination. I agree that you should only need a single request to get all 42 of your active certifications. I’m going to ask the engineering team about this to understand what is going on.
@adyer, Engineering agrees that this is strange behavior and are requesting that you please open a support ticket. They will likely need to access your logs and tenant information to figure out what is going on.
When they resolve your issue, I would greatly appreciate it if you could share the solution in this topic if it does not contain sensitive information about your environment. Others might find the solution valuable.