Enhanced Error Responses, Pagination Rules, and Data Limits

At Zaptec, we continuously strive to enhance the efficiency, performance, and reliability of our APIs. As part of this commitment, we are introducing a few important updates that will go into effect from 01-03-2025. These changes are designed to improve API consistency, optimize performance, and ensure a seamless experience for all integrators.

This article outlines the upcoming changes, the reasons behind them, and what actions you may need to take.

1. More accurate error handling for charger state requests

What’s changing?

  • Affected endpoint: GET /api/charger/{id}/state
  • If a requested charger ID does not exist, the API will now return a 404 Not Found instead of 200 OK with an empty list.
  • New 404 Response Format:
{
  "errorCode": 512,
  "message": "Charger not found."
}

Why this change?

  • Aligns with industry best practices, making it clearer when a charger ID is invalid.
  • Helps integrators handle errors more effectively, preventing misinterpretations.
  • Enhances API analytics by providing more accurate insights into invalid requests.

Action required

  • Ensure your integration properly handles 404 Not Found responses.
  • Avoid retrying requests when receiving this error status.

2. Updated pagination limits for better performance

What’s changing?

  • Affected Endpoints:
      • GET /api/installation
    • GET /api/charger
    • GET /api/chargeHistory
  • New Limits:
      • Maximum page size reduced from 5000 to 100
    • Default page size reduced from 500 to 50

Why this change?

  • Prevents excessive database load and improves API response times.
  • Reduces the risk of performance bottlenecks.
  • Ensures a more stable and efficient experience for all users.

Action required

  • Review your integration to ensure proper pagination implementation.
  • If your integration currently requests more than 100 records per page, adjust it accordingly. Any request exceeding the limit will automatically return a maximum of 100 records per page.

3. Charge history data now limited to the last 365 Days

What’s changing?

  • Affected Endpoint: /api/chargeHistory
  • New Limit: You will only be able to query charge history data for the last 365 days.

Why this change?

  • Allows us to archive older closed sessions and optimize database performance.
  • Improves response times for charge history queries.

Action required

  • If your integration currently queries charge history beyond 365 days, update your logic to comply with the new timeframe.

Next steps & support

  • Effective Date: 01-03-2025

  • Deprecation date : 1-04-2025

We understand that these updates may require some adjustments on your end, and we are here to support you. If you have any questions or need further assistance, please reach out to our support team using this link: https://help.zaptec.com/hc/en-001/requests/new

We appreciate your collaboration and look forward to continuing to improve our API experience together!

Best regards,

The Zaptec Integration Team