The HFID (Human Friendly ID) Application is a comprehensive system for managing and tracking stuff in the physical world with automatically generated unique identifiers.
Sign up to create an account.
Visit your profile at Edit Profile to generate your API key for programmatic access.
Contact an administrator to be added to an organization before creating HFIDs.
Navigate to Create HFID to create your first hardware record.
The following information is tracked with each HFID:
All API requests require authentication using your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Get your API key from your user profile.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/hfids |
List all accessible HFIDs |
| POST | /api/v1/hfids |
Create a new HFID |
| GET | /api/v1/hfids/:id |
Get specific HFID details |
Install the required Python library:
pip install requests
import requests
import json
from datetime import date
class HfidApiClient:
def __init__(self, base_url, api_key):
self.base_url = base_url.rstrip('/')
self.api_key = api_key
self.headers = {
'Authorization': f'Bearer {api_key}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
# Initialize client
client = HfidApiClient('http://localhost:3000', 'YOUR_API_KEY')
def list_hfids(self):
"""List all HFIDs accessible to the user"""
response = requests.get(
f'{self.base_url}/api/v1/hfids',
headers=self.headers
)
response.raise_for_status()
return response.json()
# Usage
hfids_response = client.list_hfids()
for hfid in hfids_response['hfids']:
print(f"HFID: {hfid['hfid']} - {hfid['ipn']}")
def create_hfid(self, ipn, organization_id, version_hw, description,
mfg_date=None, public=False):
"""Create a new HFID"""
if mfg_date is None:
mfg_date = date.today().isoformat()
data = {
'hfid': {
'ipn': ipn,
'organization_id': organization_id,
'version_hw': version_hw,
'description': description,
'mfg_date': mfg_date,
'public': public
}
}
response = requests.post(
f'{self.base_url}/api/v1/hfids',
headers=self.headers,
json=data
)
response.raise_for_status()
return response.json()
# Usage
new_hfid = client.create_hfid(
ipn="DEMO-001",
organization_id=1,
version_hw="v1.0.0",
description="Demo hardware component",
public=True
)
print(f"Created HFID: {new_hfid['hfid']['hfid']}")
def get_hfid(self, hfid_id):
"""Get a specific HFID by ID"""
response = requests.get(
f'{self.base_url}/api/v1/hfids/{hfid_id}',
headers=self.headers
)
response.raise_for_status()
return response.json()
# Usage
hfid_details = client.get_hfid(1)
print(f"HFID Details: {hfid_details['hfid']}")
| Status Code | Error Type | Description |
|---|---|---|
| 401 | Unauthorized | Missing or invalid API key |
| 403 | Forbidden | Insufficient permissions for the requested action |
| 404 | Not Found | Requested HFID does not exist or is not accessible |
| 422 | Validation Error | Request data failed validation (e.g., missing required fields) |
Daily Limits: Each user has a configurable daily limit for HFID creation (default: 5 per day).
Rate limits are enforced on HFID creation to prevent abuse. Limits reset daily at midnight and can be configured by administrators for individual users.
curl -H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
http://localhost:3000/api/v1/hfids
curl -X POST \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"hfid": {
"ipn": "CURL-001",
"organization_id": 1,
"version_hw": "v1.0.0",
"description": "Created via cURL",
"mfg_date": "2024-01-20",
"public": true
}
}' \
http://localhost:3000/api/v1/hfids
curl -H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
http://localhost:3000/api/v1/hfids/1
Need help with the HFID application?