API Test Endpoints

1. Health Check

GET /health

Curl Command:

curl -X GET http://localhost:8080/health
Response:
Click "Test Endpoint" to see the response.
2. Update Exchange Rates

POST /api/exchange

Body: {"endpoint": "update", "body": {}}

Curl Command:

curl -X POST http://localhost:8080/api/exchange \
-H "Content-Type: application/json" \
-d '{"endpoint": "update", "body": {}}'
Response:
Click "Test Endpoint" to see the response.
3. Get Exchange Rate Between Two Currencies

POST /api/exchange

Body: {"endpoint": "get", "body": {"b": "BASE_CURRENCY", "t": "TARGET_CURRENCY", "con": "CONDITION"}} (con is optional: "d" or "w")

Curl Command (example with condition):

Exchange Rate Request

curl -X POST http://localhost:8080/api/exchange \
                -H "Content-Type: application/json" \
                -d '{"endpoint": "get", "body": {"b": "USD", "t": "EUR", "con": "d"}}'
Response:
Click "Test Endpoint" to see the response.
4. Get All Current Rates

GET /api/rates

Curl Command:

curl -X GET http://localhost:8080/api/rates
Response:
Click "Test Endpoint" to see the response.
5. Get Rates History

POST /api/exchange

Body: {"endpoint": "history", "body": {"currency": "CURRENCY_CODE", "days": NUMBER_OF_DAYS}}

Curl Command (example for all history):

curl -X POST http://localhost:8080/api/exchange \
-H "Content-Type: application/json" \
-d '{"endpoint": "history", "body": {}}'

Curl Command (example for specific currency and days):

curl -X POST http://localhost:8080/api/exchange \
-H "Content-Type: application/json" \
-d '{"endpoint": "history", "body": {"currency": "USD", "days": 7}}'
Response:
Click "Test Endpoint" to see the response.
6. Get Exchange Rate (V2)

GET /api/v2/exchange/get

Query Parameters: ?b=BASE_CURRENCY&t=TARGET_CURRENCY&con=CONDITION (con is optional: "d" or "w")

Curl Command (example with condition):

curl -X GET "http://localhost:8080/api/v2/exchange/get?b=USD&t=EUR&con=d"
Response:
Click "Test Endpoint" to see the response.