Important changes to the Review Board Web API

7 views
Skip to first unread message

Christian Hammond

unread,
Mar 7, 2010, 12:21:38 AM3/7/10
to revie...@googlegroups.com, reviewb...@googlegroups.com
Hi everyone,

We've just made some important changes to the web API that will affect you if you use any existing Review Board clients with the upcoming Review Board 1.5. This includes RBTools pre-0.2RC1, post-commit hooks, etc.

First, HTTP status codes for API calls have changed. Previously, API calls would return an HTTP Status 200 if they had any payload data, even for errors. Now we use appropriate HTTP status codes for all responses. This means that any existing clients that assume that responses will be using HTTP Status 200 will need to be updated to be more flexible.

The second change, which is not in just yet, is that most API calls that return lists of things (such as review requests or reviews) will now be paginated. This means that a query will no longer return all the results, but rather will return a set number at a time.

By default, these will return 25 items at a time. This can be changed by passing a max-results= parameter to the URL. To grab a new set of items, you can pass start= to the URL to indicate which item to start the query on. This is a 0-based index.

New results will be in the JSON payload for pagination: 'total_count', 'prev_href', and 'next_href'. The 'prev_href" and 'next_href' keys provide the URLs for querying the next and previous group of batches of data.

These changes will be going in for 1.5 beta 2. It's best that people start porting over anything they've written at their earliest conveniences, preferably before the release, in case they run into problems we'd need to fix.

Christian

--
Christian Hammond - chi...@chipx86.com
Review Board - http://www.reviewboard.org
VMware, Inc. - http://www.vmware.com
Reply all
Reply to author
Forward
0 new messages