Making a request

ALL URLs start with the base url of https://api.bugwood.org/rest/api/.Responses are json.

We have a exact copy of the api to use for development https://sandbox.bugwood.org/rest/api/

Sign your requests

We started asking people to specify a user-agent on your requests... Something that identifies your application in case there are any issues. It also makes sure we don't block someone's requests by mistake. You should include a User-Agent header with both:

  • The name of your application
  • A link to your application or your email address
We use this information to get in touch if you're doing something wrong (so we can warn you before you're blacklisted) or something awesome (so we can congratulate you). Here are examples of acceptable User-Agent headers:
  • User-Agent: Divergent concepts (http://www.divergentflow.com/contact/)
  • User-Agent: Joe's great use of the BugwoodAPI (joe@example.com)

Pagination

Current limit for rows returned per request is 3000.

Option 1
url.start - this is the starting row number.
url.length - this is how many rows to return.

Option2
url.rows - number of rows to return.
url.page - page number to return.

Systems

We alter get requests based on a url param of system=(integer). To see the current valid system values use GET /system.json .

Glossary

To speed up development there is a glossary of query parameters/terms commonly used throughout the API.

Responses

API responses can be formated to work with

The API looks for query parameters unique to datatables or jqgrid to format the response accordingly. You may also append a query parameter datatable or jqgrid to any get request and format the response to be compatible. I have set up working examples of all three response types Examples. In general the jqgrid and datatable responses will be far more detailed than select2 responses, typically having more detailed key names.

Select2 default response

Tiered Select2 responses can be made from any parent API element that has a child. Here are some examples

  • Division
  • Country
  • state
  • setting
These objects will always return a normal select 2 response for the object unless a url parameter child=1 is supplied. In the case child is supplied the response is modified adding a key "children" (array of objects) each child object will contain "id", "text", "count" if system is supplied.