The Bug Genie
Please log in to subscribe to updates for this article
API Module:Usage
Last updated at Wed Feb 22 08:55, by zegenie
This API Module is still in development (TBG >= 4.1.6, API 1.0).
It is also not distributed in the default installation, but can be installed by checking out

The Bug Genie API Documentation  ⇑ top

On this documentation: Request methods are stated in the following format: PREFERRED (FALLBACK)
PREFERRED states the preferred method to be used, but any methods (or 'any') stated in braces will be accepted also.
If there are multiple formats doing different things, they will be listed in separate rows.

Example Response will always include the expected HTTP Return codes as well as the JSON representation of the usual response.

Authenticating  ⇑ top

Authentication requires a one-time application password. (This can be obtained in the account-overview page under "Security")
With this password send a request to the endpoint /api/authenticate/:username. After receiving the token, it has to be sent with every subsequent request using the parameter api_token.
For example:

CLI CommandEndpointParametersMethodsDescriptionExample Response
<!-- cli -->
since 1.0
username: The username associated with the application password.
password: The one-time application password.
POST (any) Authenticates the requestor using the username and one-time application password and creates a token for subsequent requests.
200 OK
	"token": "0123456789012345678901234567890123456789"

Response Formats  ⇑ top

All API endpoints support different formatted responses. (Currently, the /authenticate/:username endpoint is the only exception.) TBG comes with default json response templates for all API endpoints, but you can make your own by adding templates with the correct response format. All endpoints therefore accept the parameter format, which by default is "json", but can be substituted with "xml" or "html" for custom responses.

You can find which template to create by looking at the module name and action name, find the corresponding "action".json.php file and add one for your custom format. No further configuration is necessary.

Errors  ⇑ top

Generic error messages will be in the following format, with the HTTP Status Code 500:
	"error": "what went wrong"
Endpoints may return more specific error messages, see below.

API Endpoints  ⇑ top

API Related  ⇑ top

CLI CommandEndpointParametersMethodsDescriptionExample Response
<!-- cli -->
none GET (any) Returns status information on The Bug Genie and the current API module.
200 OK
    "api_version": "1.0.0",
    "tgb_version": "4.1.6",
    "tgb_version_long": "4.1.6 (\"Abstract Apricot\")",
    "tbg_name": "My Company Bugtracker",
    "tbg_url_host": "http://issues.compa.ny",
    "tbg_url": "/",
    "tbg_logo_url": "/files/show/8",
    "tbg_icon_url": "/files/show/9",
    "online": true
<!-- cli -->
none GET (any) Returns the currently logged in user (accessing the API).
200 OK
See endpoint /api/:api_username/users/:user.
TODO: Move this code sample to that endpoint!
    "id": ​123,
    "name": "Oliver Kahrmann",
    "username": "founderio",
    "type": "user",
    "display_name": "Oliver Kahrmann",
    "realname": "Oliver Kahrmann",
    "buddyname": "Oliver Kahrmann",
    "email": "",
    "avatar": "founderio",
    "avatar_url": ";s=48",
    "avatar_url_small": ";s=28",
    "url_homepage": "",
    "date_joined": ​1442351732,
    "last_seen": ​1454278047,
    "timezone": "sys",
    "language": "en_US",
        "name": "Available",
        "is_absent": false,
        "is_busy": false,
        "is_in_meeting": false,
        "is_online": true,
        "is_unavalable": false


Table Template:
CLI CommandEndpointParametersMethodsDescriptionExample Response
parameters methods description
200 OK
	"JSON": true

Article attachments

There are no file attached to this article

Article comments (0)

There are no comments