Service Overview
The SAP 10.3 Calculation Service is a high-performance RESTful API developed by Kaizen Certification Limited for calculating energy performance ratings according to the UK's Standard Assessment Procedure (SAP) version 10.3.
| Service URL | https://sap10-2-service.kaizencertification.co.uk |
|---|---|
| API Endpoint | https://sap10-2-service.kaizencertification.co.uk/api/rating |
| Content Type | application/xml |
| Response Format | application/json |
| Authentication | Bearer Token (API Key) |
Authentication & API Keys
All API requests require a valid API key passed in the Authorization header.
Internal Development Key
For External Companies & Users
- Unique API Keys: Each external company/user receives a unique API key
- Key Generation: Contact Kaizen Certification Limited for API key provisioning
- Usage Tracking: All API calls are logged in our database for monitoring
- Analytics: Monthly usage reports available upon request
Authentication Header Format
Authorization: Bearer {your-api-key}
Database Tracking
The service automatically logs the following information for each API call:
API Usage
Calculate Ratings Endpoint
Request Headers
Content-Type: application/xml
Authorization: Bearer {api-key}
Request Body
Valid SAP 10.3 XML file content (maximum 10MB)
Response Format
{
"success": true|false,
"message": "Status message",
"data": {
// Ratings object (see below)
},
"validationErrors": [],
"timestamp": "2024-01-15T10:30:00Z"
}
HTTP Status Codes
| Code | Description |
|---|---|
| 200 | Success - Calculation completed |
| 400 | Bad Request - Invalid XML format |
| 401 | Unauthorized - Invalid or missing API key |
| 422 | Unprocessable Entity - Validation errors |
| 500 | Internal Server Error |
Ratings Object
The complete Ratings class returned by the API:
Code Examples
C# Example
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
private async Task CalculateSAPRatingsAsync()
{
var apiKey = "5ad04212-786f-4265-3693-25cba23cca80";
var xmlFilePath = @"C:\Path\To\Your\SAP-Report.xml";
var apiUrl = "https://sap10-2-service.kaizencertification.co.uk/api/rating";
// Read XML file
var xmlContent = await File.ReadAllTextAsync(xmlFilePath);
using var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", apiKey);
var content = new StringContent(xmlContent, Encoding.UTF8, "application/xml");
var response = await httpClient.PostAsync(apiUrl, content);
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine($"Status Code: {response.StatusCode}");
Console.WriteLine($"Response: {responseBody}");
// Parse JSON response
// var ratingResponse = JsonConvert.DeserializeObject(responseBody);
}
Python Example
import requests
api_key = "your-api-key"
api_url = "https://sap10-2-service.kaizencertification.co.uk/api/rating"
headers = {
'Content-Type': 'application/xml',
'Authorization': f'Bearer {api_key}'
}
with open('sap-report.xml', 'r') as file:
xml_content = file.read()
response = requests.post(api_url, headers=headers, data=xml_content)
if response.status_code == 200:
ratings = response.json()
print(f"DER: {ratings['data']['Der']}")
print(f"TER: {ratings['data']['Ter']}")
else:
print(f"Error: {response.status_code}")
print(response.text)
JavaScript Example
const apiKey = "your-api-key";
const apiUrl = "https://sap10-2-service.kaizencertification.co.uk/api/rating";
async function calculateRatings(xmlContent) {
try {
const response = await fetch(apiUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/xml',
'Authorization': `Bearer ${apiKey}`
},
body: xmlContent
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const data = await response.json();
console.log('Calculation successful:', data);
return data;
} catch (error) {
console.error('Error calculating ratings:', error);
throw error;
}
}
// Usage
const xmlContent = `<?xml version="1.0"?>
<SAP-Report>
<!-- Your SAP 10.3 XML content -->
</SAP-Report>`;
calculateRatings(xmlContent);
Support & Contact
Company Address
Bishops Court
17a The Broadway
Hatfield, Hertfordshire
AL9 5HZ
United Kingdom
Service Availability: 99.5% uptime SLA
Additional Endpoints
| Endpoint | Method | Description |
|---|---|---|
/api/health |
GET | Service status and version information |
/api/validate-xml |
POST | Validate XML without performing calculations |