Hi Ramiro,
Ideally, the list of campaigns endpoint would keep track of the date when all certifications have been signed off. However, this is not available at this time. I went ahead and created an idea to provide this data directly in the list campaigns endpoint. Please up vote so the product team can prioritize this work.
In the meantime, since a campaign can have more than one certification, you will need to string together a few API calls to make this work. This will be easier if you create a script in your favorite language to do the work.
You can start by getting a list of campaigns, filtered using status eq "COMPLETED"
in the query params. You will also want to use the detail=FULL
query param to get additional fields that we can use to accomplish your task.
GET https://{tenant}.api.identitynow.com/beta/campaigns?detail=FULL&status eq "COMPLETED"
Since the list of completed campaigns will continuously grow over time, we don’t want to analyze any campaigns that are either far too old to be considered for this query, or that we have already analyzed in a previous run of the script. You can throw out any campaigns that have a deadline
that is well before your window. If you are feeling adventurous, you can keep track of which campaigns you have already analyzed in a file or database so you can throw them out as well.
Once you have your list of campaigns that you want to analyze when they were completed, we can move on to the list identity certifications endpoint. For each campaign, run the following API call:
GET https://{tenant}.api.identitynow.com/v3/certifications?filters=campaign.id eq "<campaignId>"&sorters=-signed
This will return all of the certifications for the specified campaign in descending order of when they were signed. Use the certification with the most recent signed
date (should be the first item in the array) to see if it falls within your window. If it does, add the campaign to the list of campaigns that were completed within your window.
I know this is a lot of work for what should be a simple query, but this is the only way I can see this working for now. If you manage to get this working, please share your final code/solution with us to help anyone else with the same question.