This Documentation is for the legacy TBG API Module (TBG >= 4.1.6, API 1.0).
It is also not distributed in the default installation, but can be installed by checking out https://github.com/thebuggenie/module-api
It is also not distributed in the default installation, but can be installed by checking out https://github.com/thebuggenie/module-api
The Bug Genie API Documentation
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
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:
http://issues.compa.ny/api/my_api_user/me?api_token=0123456789012345678901234567890123456789
CLI Command | Endpoint | Parameters | Methods | Description | Example Response |
---|---|---|---|---|---|
|
| 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. |
|
Response Formats
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
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
API Related
CLI Command | Endpoint | Parameters | Methods | Description | Example Response |
---|---|---|---|---|---|
|
| none | GET (any) | Returns status information on The Bug Genie and the current API module. |
|
|
| none | GET (any) | Returns the currently logged in user (accessing the API). |
See endpoint /api/:api_username/users/:user.TODO: Move this code sample to that endpoint!
|
Table Template:
CLI Command | Endpoint | Parameters | Methods | Description | Example Response |
---|---|---|---|---|---|
|
| parameters | methods | description |
|