What is the format for the minTime URI parameter in the VSTS REST API, Builds - List?

Viewed 687

Given a VSTS REST API call like this:

https://*account*/*project*/_apis/build/builds?definitions=2&minTime=????queryOrder=startTimeDescending&api-version=4.1

What is the correct datetime format for the minTime value? Everything I have tried either returns all builds, or none, and is not filtering by date. For example, I have tried "31/08/2018", "2018-08-31T12:01:31.450Z", "08/31/2018". The format is not documented anywhere that I can see.

2 Answers

The format for minTime should be YYYY-MM-DD.

So the request URL looks like:

https://marinaliu.visualstudio.com/Git2/_apis/build/builds?definitions=41&queryOrder=queueTimeDescending&minTime=2018-09-01&api-version=4.1

Note: when you specify minTime in the request url, it's not working to specify queryOrder with startTimeDescending. Instead, you can remove &queryOrder=startTimeDescending from url, or you can replace with queueTimeDescending.

&minTime=2022-04-18T00:00:00&maxTime=2022-04-19T23:59:00

This also worked for me with time component in addition to date component.

Related