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.1.tar.gz (7.1 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.1-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ossit-0.2.1.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

Hashes for ossit-0.2.1.tar.gz
Algorithm Hash digest
SHA256 56cb679d249229ba429167e86488024057594540740e673ccc398645b7a21357
MD5 102017d36c00b87c3c0bbbb7555ed415
BLAKE2b-256 ceec34cda702c5b2ac2b45536e76cfccb480bd6ff661919bcfe76952a2393502

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ossit-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1d22a5f693321403006a52200c675d0f3ea1bbaf912e436e800d25614334cef2
MD5 80606ba476453c1b218f235377e4b773
BLAKE2b-256 1c2ef647f71fd20cf083dc2b600ed14d2f1ef3c9d9318f8d4d6e12129e6b509a

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