Python Package to connect to ossit API
Project description
Ossit API Documentation
Ossit is an easy-to-use statistic collecting application that analyzes and displays your data. It follows a three-tier structure:
Structure
-
Domains: The highest level, which produces keys for user authentication. To set your Ossit domain key, import the Ossit library and set the domain key as follows:
-
Statistic Groups: This tier allows you to group common statistics, providing better organization and analysis of your data. For example, you could create a group for "Website Traffic" that includes statistics such as page views, unique visitors, and bounce rate.
-
Statistics: The lowest level, consisting of individual statistics with a name and value.
Authentication and Authorization
To authenticate your requests, set your Ossit domain key. You can find your domain key in the Ossit dashboard.
import ossit
ossit.set_domain_key('YOUR_SECRET_KEY')
ossit.set_time_zone('America/Toronto')
Base URL
The base URL for the Ossit API is https://ossit.ca/v1/api. All API responses will be in JSON format.
Endpoint Structure
Each tier and future objects will follow the same URL path structure. For example, the Statistic Groups resource has the following endpoints:
- POST /statistic-groups: Creates a new statistic group.
- GET /statistic-groups: Retrieves a list of all statistic groups.
- PUT /statistic-groups/:id: Updates the specified statistic group.
- GET /statistic-groups/:id: Retrieves the specified statistic group.
Examples
Here's an example of creating a new statistic group using the Ossit package:
import ossit
ossit.domain_key = 'YOUR-KEY'
group = ossit.StatisticGroup.create('Automations')
print(group)
To retrieve a list of all statistic groups:
groups = ossit.StatisticGroup.list()
print(groups)
Error Handling
If an error occurs, the API will return an error response in the following format:
{
"error": {
"code": "ERROR_CODE",
"message": "Error description"
}
}
Common error codes include:
- 400 Bad Request: The request is malformed or contains invalid data.
- 401 Unauthorized: The request is missing or has an invalid authentication token.
- 403 Forbidden: The authenticated user does not have permission to perform the requested action.
- 404 Not Found: The requested resource could not be found.
- 500 Internal Server Error: An unexpected error occurred on the server side.
Rate Limiting and Throttling
To ensure fair usage, the Ossit API enforces rate limiting. By default, users are limited to 1000 requests per hour. If you exceed this limit, you will receive a 429 Too Many Requests response.
Versioning
The current version of the Ossit API is v1. To access different versions of the API (if available), replace the version number in the base URL (e.g., https://ossit.ca/v2/api).
Changelog
Maintain a changelog of API updates and improvements. Include the version, release date, and a brief summary of changes for each update.
Support and Contact Information
For API support and feedback, please contact our support team at wesleyh@stratusadv.com
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ossit-0.2.2.tar.gz.
File metadata
- Download URL: ossit-0.2.2.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7873181c5d6309d37d3cb04826af81443e617c1331a07af5b4a202a6acb93707
|
|
| MD5 |
3d6f1e82cdd9f03e6f191eebaa214525
|
|
| BLAKE2b-256 |
186cc9fe65caea76262578de51942de115e54123e40cc6ca83af15c72cd1e06f
|
File details
Details for the file ossit-0.2.2-py3-none-any.whl.
File metadata
- Download URL: ossit-0.2.2-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86d7c0f8ca7216cf9f6af5d95ed88f5ee78c1de6c5c0401ddd98577b36f21cb2
|
|
| MD5 |
1814a5fd461bd46827a04d62fba3a262
|
|
| BLAKE2b-256 |
85228db8337676611a4efe06fb7967804f5582f5276ddbad6fada62cdde773a7
|