Versioning
Current Version
The API is currently at v1. All requests must include the version prefix in the URL:
https://api.electiondata.my/v1For example: https://api.electiondata.my/v1/candidates?id=CMVBA
Requests without a version prefix will receive a 400 Bad Request response.
Breaking Changes
All changes within the same version will be backwards compatible, so you can be confident that your products won’t break. The following are considered breaking changes and will be versioned:
- Removing or renaming existing fields from response objects.
- Changing the type or format of existing response fields.
- Removing or renaming existing endpoints.
- Making previously optional parameters required.
The following are considered non-breaking changes and may happen at any time without notice:
- Adding new optional query parameters to existing endpoints.
- Adding new fields to JSON response objects.
- Adding new endpoints.
- Improving error messages or adding additional detail to existing error responses.
Yes, this isn’t REST
Using a /v1/ prefix is a REST anti-pattern—a true REST API would rely on HATEOAS (Hypermedia as the Engine of Application State) to communicate resource locations and transitions, rather than encoding a version in the path.
This is a deliberate design choice. The primary consumers of this API include journalists, civic society organisations, and developers doing work in support of core public-interest functions. For these users, simplicity and predictability matter more than architectural purity. A URL that says /v1/candidates is immediately understandable. HATEOAS is not.