Generating an API Key

Heeler has an API Key generator to allow for easier API authentication. The API key grants the same scopes and permissions as the user that created it.

To create, an API key,

  1. Select the icon from the top navigation

  2. Navigate to the API Keys tab

  3. Click Create API Key

  4. Provide the API key a name and choose its duration, e.g., 7 days

  1. Click Create and then copy the API key using the copy button provided (N.b., all keys used to prepare this documentation have been deleted)

  1. In your terminal, add the API key as an environment variable, e.g.,

export H4R_API_KEY=h4r-184ae2a39d-2c1db1aab3efdf4e094ced7aad2b5dee98661dd3
  1. Then use the API key to authenticate. To test, you can use this simple script, which saves a listing of your services in JSON format.

import json
from datetime import datetime
from os import environ

import requests

API_KEY = environ.get("H4R_API_KEY")

if not API_KEY:
    raise ValueError("H4R_API_KEY environment variable is not set. Please set it before using this script.")

BASE_URL = "https://app.heeler.com"

headers = {"Authorization": "Bearer " + API_KEY, "Accept": "application/json"}


def list_services():
    response = requests.get(f"{BASE_URL}/api/services", headers=headers)
    return response.json()

services = [service for service in list_services()["items"]]

# print(json.dumps(services, indent=2))

timestamp = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
filename = f"api_service_listing_{timestamp}.json"

with open(filename, "w") as f:
    json.dump(services, f, indent=2)

print(f"Export written to {filename}")
  1. Save the script as a file, e.g., test_api_script.py , and then execute it

python test_api_script.py
  1. And you should see a confirmation like

Export written to api_service_listing_2025-05-15_17-18-26.json

Last updated

Was this helpful?