📋 Overview
The CardGU Middleware API provides read-only access to TEMC and Tomcard data. All endpoints require API key authentication.
🔐 Authentication
All API requests must include an API key in the request header:
All API requests must include an API key in the request header:
X-API-Key: your_api_key_here
📝 Demo API Keys:
•
•
•
demo_api_key_12345•
test_api_key_67890
🔗 Base URL
https://customers.temnplc.cards/api/v1
📦 Response Format
All responses follow this standard format:
{
"status": "success|error",
"code": 200,
"message": "Descriptive message",
"data": { ... },
"meta": {
"timestamp": "2026-01-20T10:30:00+00:00",
"version": "1.0"
}
}
🔧 TEMC Endpoints
GET /api/v1/temc
Description: Retrieve list of all TEMC records
Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
| limit | integer | 100 | Maximum number of records to return |
| offset | integer | 0 | Number of records to skip |
| order_by | string | temcid | Field to order by |
| order_dir | string | DESC | Sort direction (ASC or DESC) |
| temcno | string | - | Filter by TEMC number |
| temcsap | string | - | Filter by TEMC SAP |
| temccustomer | string | - | Filter by customer |
Example Request:
curl -X GET "https://customers.temnplc.cards/api/v1/temc?limit=10&offset=0" \ -H "X-API-Key: demo_api_key_12345"
Example Response:
{
"status": "success",
"code": 200,
"message": "TEMC records retrieved successfully",
"data": {
"records": [
{
"temcid": "1",
"temcno": "TEMC001",
"temcsap": "SAP001",
"temccustomer": "Customer A",
"temcupdatedby": "admin",
"temcupdatedon": "2026-01-20 10:30:00",
"temccreatedon": "2026-01-15 09:00:00"
}
],
"pagination": {
"total": 1,
"limit": 10,
"offset": 0,
"count": 1
}
},
"meta": {
"timestamp": "2026-01-20T10:30:00+00:00",
"version": "1.0"
}
}
GET /api/v1/temc/{id}
Description: Retrieve a single TEMC record by ID
Path Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | integer | Yes | TEMC record ID |
Example Request:
curl -X GET "https://customers.temnplc.cards/api/v1/temc/1" \ -H "X-API-Key: demo_api_key_12345"
Example Response:
{
"status": "success",
"code": 200,
"message": "TEMC record retrieved successfully",
"data": {
"temcid": "1",
"temcno": "TEMC001",
"temcsap": "SAP001",
"temccustomer": "Customer A",
"temcupdatedby": "admin",
"temcupdatedon": "2026-01-20 10:30:00",
"temccreatedon": "2026-01-15 09:00:00"
},
"meta": {
"timestamp": "2026-01-20T10:30:00+00:00",
"version": "1.0"
}
}
🎴 Tomcard Endpoints
GET /api/v1/tomcard
Description: Retrieve list of all Tomcard records
Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
| limit | integer | 100 | Maximum number of records to return |
| offset | integer | 0 | Number of records to skip |
| order_by | string | tomid | Field to order by |
| order_dir | string | DESC | Sort direction (ASC or DESC) |
| tomno | string | - | Filter by Tom number |
| tomsap | string | - | Filter by Tom SAP |
| tomcustomer | string | - | Filter by customer |
Example Request:
curl -X GET "https://customers.temnplc.cards/api/v1/tomcard?limit=10" \ -H "X-API-Key: demo_api_key_12345"
GET /api/v1/tomcard/{id}
Description: Retrieve a single Tomcard record by ID
Path Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | integer | Yes | Tomcard record ID |
Example Request:
curl -X GET "https://customers.temnplc.cards/api/v1/tomcard/1" \ -H "X-API-Key: demo_api_key_12345"
❌ Error Responses
401 Unauthorized
{
"status": "error",
"code": 401,
"message": "Unauthorized. Valid API key required in X-API-Key header.",
"meta": {
"timestamp": "2026-01-20T10:30:00+00:00",
"version": "1.0"
}
}
404 Not Found
{
"status": "error",
"code": 404,
"message": "Record not found",
"errors": null,
"meta": {
"timestamp": "2026-01-20T10:30:00+00:00",
"version": "1.0"
}
}
500 Internal Server Error
{
"status": "error",
"code": 500,
"message": "Failed to retrieve records",
"errors": null,
"meta": {
"timestamp": "2026-01-20T10:30:00+00:00",
"version": "1.0"
}
}
📊 HTTP Status Codes
| Code | Description |
|---|---|
| 200 | Success - Request completed successfully |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Missing or invalid API key |
| 404 | Not Found - Resource does not exist |
| 500 | Internal Server Error - Server error occurred |
💡 Best Practices
- Always include the
X-API-Keyheader in all requests - Use pagination (limit/offset) for large datasets
- Implement proper error handling in your client application
- Cache responses where appropriate to reduce API calls
- Check the
meta.timestampfield to track when data was retrieved
📞 Support: For API access or questions, contact your system administrator.