Date filter for Octopus APIs

(Falcon Francis) #1

Is there anyway to pass the date time filter to deploymenthistory or any other api in Octopus?

We have skip and take filters, but that does not help much.
Problem happens when I want to pull deployment data for an older date.
There is no way other than loading each page then take the Page.Next value and compare the date.

I know we can achieve this using PowerShell and SQL scripts. But I am looking for a solution specifically with APIs.

(Paul Calvert) #3

HI @Falcon_Francis,

Thanks for getting in touch!

Unfortunately not, these are the only filters available for the API call:


(Falcon Francis) #4

Thank you for your answer.

We have to be careful while using APIs because the data is keep on getting updated due to the continuous deployments.

For eg: If we try to take the tasks details using api ‘/api/tasks?skip=0&take=30’
Link to “next page” will be shown as ‘/api/tasks?skip=30&take=30’
The data for the “next page” may have some details which are already present in the ‘/api/tasks?skip=0&take=30’ if a new release and deployment has been queued during the query execution.

So APIs has to be used only with some logic to make sure we are not processing the duplicate data.

1 Like