# Quickstart Guide
Our API is a RESTful JSON API with specific endpoints that accept JSON data and returns a JSON response with the appropriate standard http response codes.
# Authentication
Skhokho API uses basic https authentication. All requests to the API must be authenticated by adding an authentication header to the request which should include the username and password of the account holder.
# Postman
- Navigate to the first tab called "Authorisation".
- Select "Basic Auth" from the drop down list.
- Enter your username and password (that you created on Skhokho)
Now you are ready to send any request to the API.
Let us test your connection by sending a GET request to the following url.
https://skhokho.io/api/v1.0/me
You should get back the following response:
{
"user": {
"first_name": "Mpho",
"last_name": "Brown",
"email": "mphobrown@gmail.com"
},
"jobTitle": "Founder/CEO",
"managerModule": true,
"clientModule": false,
"hrModule": true,
"accountingModule": true,
"operationsModule": true,
"salesModule": true
}
# Python
To authenticate a request programatically with Python you would need the requests library. Install requests first on the command line, inside your virtual environment or globally with:
pip install requests
import requests
import json
url = 'https://skhokho.io/api/v1.0/me'
username = enterUsername
password = enterPassword
r = requests.get(url, auth=(username, password))
json.loads(r.text)
# URL Structure
The base API URL is:
https://skhokho.io/api/v1.0/
The current API Version is v1.0
All the API endpoints are appended at the end of this API version.
# API Response Codes
Below is a list of possible response codes that can be returned by the API.
- 200 - Accepted
- 201 - Created
- 202 - Accepted
- 400 - Bad Request
- 401 - Unauthorised
- 404 - Not Found
- 500 - Internal Server Error
# Version History
v1.0 - this is the initial API version released 20 September 2022.
When using this version, add it to the base URL here:
https://skhokho.io/api/{version-number}/
In future as the API is updated, the version numbers will change, the old version will still be active as not to break your code, always refer to this part of the documentation to get the latest API version.
# API Endpoints
All the API endpoints are names after the data entity that they call. Every endpoint will have the following methods:
- GET - Fetch a list of rows
- POST - Create a new row in the table
URL pattern for an endpoint is:
https://skhokho.io/api/v1.0/{endpoint}
Available endpoints include:
Endpoint | Skhokho Application | Endpoint |
---|---|---|
Accounts | Accounting App | https://skhokho.io/api/v1.0/accounts |
Clients | Accounting App | https://skhokho.io/api/v1.0/clients |
Products | Accounting App | https://skhokho.io/api/v1.0/products |
Quotes | Accounting App | https://skhokho.io/api/v1.0/quotes |
Quote Items | Account App | https://skhokho.io/api/v1.0/quote-items |
Invoices | Accounting App | https://skhokho.io/api/v1.0/invoices |
Invoice Items | Accounting App | https://skhokho.io/api/v1.0/invoice-items |
Vendors | Accounting App | https://skhokho.io/api/v1.0/vendors |
Expenses | Accounting App | https://skhokho.io/api/v1.0/expenses |
Projects | Project Management App | https://skhokho.io/api/v1.0/projects |
Contacts | CRM App | https://skhokho.io/api/v1.0/contacts |
Hustles | CRM App | https://skhokho.io/api/v1.0/hustles |
TIP
Remember to always use the latest version number that is published in this documentation in the url.
# Pagination
Skhokho API supports page number pagination. A successfully authenticated GET request will return a list of items based on the endpoint. The maximum records returned is 10, the previous, next url and total count of records will be provided with each result.
See example below:
{
"count": 22,
"next": "https://skhokho.io/api/v1.0/accounts?page=2",
"previous": null,
"results": [
{
"id": 160,
"title": "Testing",
"description": "This is where you can see your practice client list.",
"category": "COST OF SALES",
"openingBalance": null,
"active": false,
"allowBooking": false
},
. . . . //Other Results
]
}
According to this response, the previous URL us null - this is because the current URL is the default:
https://skhokho.io/api/v1.0/accounts
The next URL is:
https://skhokho.io/api/v1.0/accounts?page=2
Total count is 22.
Results present the list of current max 10 entries collected.