View Source

Since QuickBuild 4.0, you can retrieve changes via RESTful APIs. The base URI for changes RESTful APIs is:
{code}
/rest/changes
{code}

h3. List all supported APIs
||URI||Response Type||Params||
|/rest/changes/help|_text/html_| |


h3. Get the data version of changes
||URI||Response Type||Params||
|/rest/changes/version|_text/plain_| |

h3. Get the commit stats
||URI||Response Type||Params||
|/rest/changes/stats/\{configuration_id}|_application/xml_| * *configuration_id*
Id of the configuration.
* *build_id*
The build id you want.
* *from_build*
Specify the from build when finding changes in a build range.
* *to_build*
Specify the to build when finding changes in a build range.
* *from_date*
Specify the from date when finding changes in a build range.
* *to_date*
Specify the to date when finding changes in a build range.
* *date_pattern*
Specify the date pattern when query by a date range, by default, the pattern is yyyyMMdd.
* *repository*
Get the changes only in a specific repository.
* *committer*
Get the changes only committed by the specified committer|

*Query stats of a specific build*
{code}
http://quickbuild:8810/changes/stats/25?build_id=102
{code}

the response looks like:
{code}
<stats commits="5" modifications="7" added="2" modified="3" deleted="2"/>
{code}

*Query stats for a build range*
{code}
http://quickbuild:8810/changes/stats/25?from_build=100&to_build=120
{code}

*Query stats for a date range*
{code}
http://quickbuild:8810/changes/stats/25?from_date=20110501&to_date=20110601
{code}
by default, the date pattern is _yyyyMMdd_, you can also specify the date pattern by adding parameter *date_pattern*, the valid date pattern can be found [here|http://download.oracle.com/javase/1.5.0/docs/api/java/text/SimpleDateFormat.html], for example:
{code}
http://quickbuild:8810/changes/stats/25?from_date=2011-05-01&to_date=2011-06-01&date_pattern=yyyy-MM-dd
{code}

*Query stats of a specific repository or committer*
By adding _repository_ or _committer_ parameter, you can get the stats of a specific repository or committer, for example:
{code}
http://quickbuild:8810/changes/stats/25?build_id=102&repository=mysvn
{code}

this will get the stats data for repository mysvn.

h3. Retrieve the commits
||URI||Response Type||Params||
|/rest/changes/\{configuration_id}|_application/xml_|* *configuration_id*
The id of configuration.
* *build_id*
The id of a specific build.
* *from_build*
Specify the from build when finding changes in a build range, must be specified with to_build.
* *to_build*
Specify the to build when finding changes in a build range, must be specified with from_build.
* *date_pattern*
Specify the date pattern when query by a date range, by default, the pattern is yyyyMMdd.
* *from_date*
Specify the from date when finding changes in a build range.
* *to_date*
Specify the to date when finding changes in a build range.
* *repository*
Get the changes only in a specific repository.
* *committer*
Get the changes only committed by the specified committer.
* *offset*
Specify the first record when iterate the records.
* *limit*
Specify the number of total records you want to retrieve.
* *asc*
Boolean type, specify the order by commit date ascendent or descendent, by default, it is false.|