Gandom API Overview
Gandom provides full API access for every action available in the accounting system. This API-first approach ensures that it can be easily integrated with other systems in an organization. Also the whole accounting process from data entry to regular reportings can be automated with writing a connector layer that communicated with the API.
This section of the documentation provides an overview of the API endpoints and describes their usage. Start from these sections if you are new to Gandom API:
- Base Accounting API: Viewing and creating "entries", the basic building blocks of accounting operations.
You can also view the browsable API documentation in Django REST framework. More standard documentation format will be added soon.
Authentication
For getting an API token, use POST /api/auth-token/login/ and pass your user's credential with HTTP basic authentication. Add the generated token in Authorization: Token YOUR_TOKEN_HERE header in your API requests for authorization.
The token stays the same and does not expire as long you are using it at least once a month in any API call, so it can be hardcoded in project ENV settings for convenience.
Errors
If an API call is not successful, a 4xx or 5xx HTTP response code is returned. Error responses usually include more detail in the following format:
{
"error": {
"code": "validation_error",
"message": "Cannot validate entry."
}
}
The error object attributes are explained in this table:
| Parameter | Type | Description | Example |
|---|---|---|---|
| code | str |
Code is a string that uniquely indicates the reason or type of the error. Code can be used in programs to resolve and detect the cause of problem. | "validation_error" |
| message | str |
Message provides human readable details about the error. It can be used to show the error to end users. | "Cannot validate entry." |
| field | str |
If the error is parameter-specific, this parameter indicates the field related to the error. It is optional and may not exist, and can be used to display a message near the correct form field. | "description" |
| errors | list[Error] |
If multiple separate error are detected, they may be provided in a list of separate error objects. | [{"code": "e1", …}, {"code: "e2", …}] |