The categories dictionary provides the taxonomy of all product categories.
Use it to enrich products, build filters, or power a category tree in your UI.
Base URL: https://api.salescaddy.ai/api
Endpoints
-
GET
/categories
Returns the full dictionary (JSON). Withexport=true→ CSV file (binary). -
GET
/categories/{categoryId}
Returns details for a specific category.
Headers
Authorization: Bearer <token>— requiredX-On-Behalf-Of-User: [email protected]— required only whenexport=true
Example — Get all categories (JSON)
curl -X 'GET' \
'https://api.salescaddy.ai/api/dictionary/product-categories' \
-H 'accept: application/json' \
-H "Authorization: Bearer $TOKEN"const url = "https://api.salescaddy.ai/api/categories";
const res = await fetch(url, { headers: { Authorization: `Bearer ${process.env.TOKEN}` } });
console.log(await res.json());import os, requests
r = requests.get("https://api.salescaddy.ai/api/categories",
headers={"Authorization": f"Bearer {os.environ['TOKEN']}"})
print(r.json())using System.Net.Http.Headers;
var http = new HttpClient();
http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", TOKEN);
var res = await http.GetAsync("https://api.salescaddy.ai/api/categories");
Console.WriteLine(await res.Content.ReadAsStringAsync());Sample response (trimmed):
[
{
"id": "0021cc0f-8110-4bc5-8fa0-536ad7052d5d",
"name": "Virtual Desktop Infrastructure (VDI)"
},
{
"id": "002f4fa6-ea2d-41e8-a776-3876b3080674",
"name": "URL Shortener"
},
{
"id": "00310aff-86ea-4e11-b032-8606c598ddab",
"name": "Tax & Revenue Collection"
},
{
"id": "0050a89e-7e31-400d-87d6-a546b3b3671c",
"name": "Other Political"
},
....
]Tips & best practices
- Categories form a hierarchy (use
parentIdto build a tree). - Use
categoryIdwhen searching products or joining usage metrics. - Cache this dictionary (changes infrequently).
- For large analytics, prefer CSV export.
Errors
| Code | Meaning | How to fix |
|---|---|---|
| 400 | Bad request | Validate query/path. |
| 401 | Unauthorized | Provide/refresh Bearer token. |
| 403 | Forbidden | Check client permissions; include X-On-Behalf-Of-User for CSV. |
| 404 | Not found | Category not found. |
| 429 | Rate limit exceeded | Retry with exponential backoff. |
| 500 | Internal server error | Retry later; contact support if persistent. |
