Testing: API
Test pagination, filtering, error handling, and authentication.
Demo Credentials
| Role | Password | Tenant | |
|---|---|---|---|
| Admin | daniel.harris@example.com | Demo1234! | demo-association |
Test 1: Authentication
- 🔵 Advanced — API / Code
# Login
curl -s -X POST https://ams.14.jugaar.ai/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"daniel.harris@example.com","password":"Demo1234!","tenant_id":"demo-association"}'
# Get user info
curl -s https://ams.14.jugaar.ai/api/v1/auth/me \
-H "Authorization: Bearer $TOKEN"
Test 2: Pagination
- 🔵 Advanced — API / Code
# First page
curl -s "https://ams.14.jugaar.ai/api/v1/members/?page=1&per_page=10" \
-H "Authorization: Bearer $TOKEN"
# Second page
curl -s "https://ams.14.jugaar.ai/api/v1/members/?page=2&per_page=10" \
-H "Authorization: Bearer $TOKEN"
Test 3: Error Handling
- 🔵 Advanced — API / Code
# 401 — No token
curl -s -o /dev/null -w "%{http_code}" https://ams.14.jugaar.ai/api/v1/members/
# Expected: 401
# 404 — Not found
curl -s -o /dev/null -w "%{http_code}" https://ams.14.jugaar.ai/api/v1/members/nonexistent \
-H "Authorization: Bearer $TOKEN"
# Expected: 404
# 422 — Validation error
curl -s -o /dev/null -w "%{http_code}" -X POST https://ams.14.jugaar.ai/api/v1/members/ \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{}'
# Expected: 422
Test 4: Trailing Slash
- 🔵 Advanced — API / Code
warning
All list endpoints require a trailing slash!
# ✅ Correct — trailing slash
curl -s -o /dev/null -w "%{http_code}" https://ams.14.jugaar.ai/api/v1/members/ \
-H "Authorization: Bearer $TOKEN"
# Expected: 200
# ❌ Wrong — no trailing slash (returns 307 redirect)
curl -s -o /dev/null -w "%{http_code}" https://ams.14.jugaar.ai/api/v1/members \
-H "Authorization: Bearer $TOKEN"
# Expected: 307
Test 5: Health Check
- 🟢 Easy — Click Around
- 🔵 Advanced — API / Code
- Go to
https://ams.14.jugaar.ai/health - ✅ See JSON with service status
curl -s https://ams.14.jugaar.ai/health | python3 -m json.tool
Expected HTTP Status Codes
| Code | Meaning |
|---|---|
200 | Success |
201 | Created |
401 | Not authenticated |
403 | Forbidden (wrong role) |
404 | Not found |
422 | Validation error |
307 | Redirect (missing trailing slash) |