Base URL used below: http://localhost:8080
Endpoint: POST /notifications
Path params: none
Query params: none
Headers:
Content-Type: application/jsonIdempotency-Key: notif-user-1001-order-5001(optional but recommended)
Request body (example):
{
"userId": "user-1001",
"message": "Your OTP is 482913",
"channel": "SMS",
"templateId": "otp-template",
"variables": {
"otp": "482913",
"appName": "NotifyApp"
}
}Endpoint: GET /notifications/{notificationId}
Path params:
notificationId(required)
Example:
curl -X GET "http://localhost:8080/notifications/2d602c59-7a10-4f2e-8d1e-4b1f9d4d5012"Endpoint: GET /admin/notifications
Path params: none
Query params:
status(optional):PENDING | PROCESSING | SENT | FAILED | RETRIED | DLQ
Example:
curl -X GET "http://localhost:8080/admin/notifications?status=FAILED"Endpoint: POST /admin/notifications/{notificationId}/retry
Path params:
notificationId(required)
Example:
curl -X POST "http://localhost:8080/admin/notifications/2d602c59-7a10-4f2e-8d1e-4b1f9d4d5012/retry"Endpoint: PUT /admin/templates
Path params: none
Query params: none
Headers:
Content-Type: application/json
Request body (example):
{
"templateId": "welcome-template",
"channel": "EMAIL",
"content": "Hi {{name}}, welcome to NotifyApp."
}Endpoint: GET /admin/templates
Path params: none
Query params: none
Example:
curl -X GET "http://localhost:8080/admin/templates"Endpoint: GET /admin/templates/{templateId}
Path params:
templateId(required)
Query params:channel(required):EMAIL | SMS | PUSH
Example:
curl -X GET "http://localhost:8080/admin/templates/welcome-template?channel=EMAIL"Endpoint: PUT /preferences/{userId}
Path params:
userId(required)
Headers:
Content-Type: application/json
Request body (example):
{
"emailEnabled": true,
"smsEnabled": false,
"pushEnabled": true
}Endpoint: GET /preferences/{userId}
Path params:
userId(required)
Example:
curl -X GET "http://localhost:8080/preferences/user-1001"Endpoint: GET /actuator/health
Body: none
Example:
curl -X GET "http://localhost:8080/actuator/health"Endpoint: GET /actuator/info
Body: none
Example:
curl -X GET "http://localhost:8080/actuator/info"Endpoint: GET /actuator/metrics
Body: none
Example:
curl -X GET "http://localhost:8080/actuator/metrics"