REST API

The REST API is only available on TeamHub Pro.

Endpoints

We have the following API endpoints exposed.

Base URL: https://api.teamhub.co.za/v1

Endpoint Verb URL Params Example Rate Limit
/balances GET
  • date
    • Format: YYYY-MM-DD
    • Optional, defaults to current month end
/balances?date=2019-06-30 Once per hour

API Key

Please contact Support

Authentication

Ensure any requests have a header with your API Key supplied

Authorization: Bearer <ApiKey>

Example:

Authorization: Bearer c62f64fa2411408ab668a49896b42840

Rate Limiting

You will receive error code HTTP 429 (Too Many Requests) if you exceed the rate limits in place per endpoint.

NB: Do not abuse this API and apply a practical retry / timeout mechanisms.

Examples

Query:

curl -H "Authorization: Bearer c62f64fa2411408ab668a49896b42840" -X GET https://api.teamhub.co.za/v1/balances

JSON Result:

[
  {
    "id": "XXonp9ChrA4BFjqeP",
    "name": "Name Surname",
    "username": "[email protected]",
    "balances": [
      {
        "type": "A9GuNtJxXFt5iwm9J",
        "name": "Annual 20",
        "days": "10.0000",
        "date": "2019-05-31"
      },
      {
        "type": "AykgzKdGDPCaEaMjC",
        "name": "Sick",
        "days": "28.0000",
        "date": "2019-05-31"
      },
      {
        "type": "AiXw5DsXkyaLKgCRh",
        "name": "Study",
        "days": "5.0000",
        "date": "2019-05-31"
      },
      {
        "type": "AMscSqmGGSjBT4P4E",
        "name": "Unpaid",
        "days": "-2.0000",
        "date": "2019-05-31"
      }
    ]
  },

  .
  .
  .
]