Skip to main content

Base URL

All API endpoints are relative to your server’s base URL:
http://localhost:8080/api

Authentication

This API does not currently require authentication. All endpoints are publicly accessible.

Response Format

All API responses are returned in JSON format with appropriate HTTP status codes.

Success Response

Successful requests return a 200 OK status code with the requested data:
{
  "id": 1,
  "code": "USD",
  "fullName": "United States Dollar",
  "sign": "$"
}

Error Response

Errors return appropriate HTTP status codes with error details:
{
  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
  "title": "One or more validation errors occurred.",
  "status": 400,
  "errors": {
    "message": ["Не заполнен один или несколько параметров"]
  }
}

Common Status Codes

200
OK
Request successful, data returned
400
Bad Request
Invalid request parameters or validation error (ArgumentException)
404
Not Found
Requested resource not found
409
Conflict
Operation conflict, such as unable to find or create an exchange rate (InvalidOperationException)
500
Internal Server Error
Server error occurred during request processing

Error Handling

The API validates all input data and returns detailed error messages. Common validation errors include:
  • Empty or null values: Required fields cannot be empty
  • Invalid length: String fields must meet minimum and maximum length requirements
  • Invalid characters: Fields must match allowed character patterns
  • Invalid currency codes: Currency codes must exist in the system

Validation Rules

Currency Fields:
  • Code: 3-5 uppercase letters (A-Z)
  • FullName: 3-60 characters (letters, spaces, parentheses)
  • Sign: 1-3 characters (no whitespace or newlines)
  • Rate: Must be a valid float value
Search Strings:
  • 1-24 characters
  • Allowed: letters, spaces, parentheses

Rate Limiting

There are currently no rate limits on API requests.

API Endpoints

The API is organized into three main sections:

Build docs developers (and LLMs) love