Skip to main content

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

  1. 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:

  2. 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.

  3. 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

ossit-0.2.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ossit-0.2.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file ossit-0.2.0.tar.gz.

File metadata

  • Download URL: ossit-0.2.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for ossit-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6de8f0c55cd958f1d8471a94b379dcb9e2aca15665c8cb79f27acc6be0d6c4fc
MD5 d8a79e7e0ee679e8f941e34580e21da5
BLAKE2b-256 a49e7d816fc506175c4379ff199d467f71f9112d4fa1bf16d94bcfa1dfba197e

See more details on using hashes here.

File details

Details for the file ossit-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ossit-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for ossit-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 27aaea2dddd7d8dce6636d15358ad7cd4382a18f8c8ebf67c0d94000f46aaac1
MD5 3f897153c0d0798f94948f1983056eb1
BLAKE2b-256 c906569b0c0122c6e8a750afcdcdccbd6404c2bea3025231f0c185fc786c6df2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page