LCR Platform Dashboard
Welcome to the Least Cost Routing Platform
Platform Statistics
Loading...
Platform Info
Your Role:
Environment: Azure Cloud
Database: Azure SQL
API Documentation
Use these endpoints to integrate with the LCR Platform programmatically
Authentication
All API requests require JWT authentication.
Base URL: http://localhost:5180
Your Current JWT Token:
Bearer [token]
1. Login to get JWT token:
POST /api/auth/login
Content-Type: application/json
{
"username": "your_username",
"password": "your_password"
}
2. Use JWT token in requests:
Authorization: Bearer YOUR_JWT_TOKEN
LCR Query
Find the best route for a phone number
Endpoint:
GET /api/lcr/query?number=PHONE_NUMBER
Authorization: Bearer YOUR_JWT_TOKEN
Example:
GET /api/lcr/query?number=14165551234
Authorization: Bearer YOUR_JWT_TOKEN
Response:
{
"phoneNumber": "14165551234",
"cleanNumber": "14165551234",
"bestRate": {
"route": "fibernetics",
"rate": 0.00110,
"prefix": "1416",
"isOverride": false,
"routeId": 7,
"country": "Ontario"
},
"currentOverride": null,
"allMatchingRates": [
{
"route": "fibernetics",
"rate": 0.00110,
"prefix": "1416",
"isOverride": false,
"routeId": 7,
"country": "Ontario"
},
{
"route": "iristel",
"rate": 0.00120,
"prefix": "1416",
"isOverride": false,
"routeId": 8,
"country": "Ontario"
},
// ... more routes ...
]
}
Routes Management
Get all routes:
GET /api/routes
Authorization: Bearer YOUR_JWT_TOKEN
Create new route:
POST /api/routes
Authorization: Bearer YOUR_JWT_TOKEN
Content-Type: application/json
{
"name": "new-route",
"status": true
}
Update route:
PUT /api/routes/{id}
Authorization: Bearer YOUR_JWT_TOKEN
Content-Type: application/json
{
"name": "updated-route",
"status": false
}
Rates Management
Get rates for a route:
GET /api/rates?routeId={routeId}
Authorization: Bearer YOUR_JWT_TOKEN
Upload rates via CSV:
POST /api/upload/rates
Authorization: Bearer YOUR_JWT_TOKEN
Content-Type: multipart/form-data
FormData:
file: rates.csv
routeId: 1
CSV Format:
Prefix,RatePerMin,Country
1415,0.0125,USA
1212,0.0130,USA
44,0.0200,UK
Overrides
Get all overrides:
GET /api/overrides
Authorization: Bearer YOUR_JWT_TOKEN
Create override:
POST /api/overrides
Authorization: Bearer YOUR_JWT_TOKEN
Content-Type: application/json
{
"prefix": "1415",
"rate": 0.0100,
"routeId": 1,
"country": "USA"
}
Route Error Reporting
Log route error (Phone Switch):
POST http://localhost:5180/api/routeserror?route=idt-gold&number=14165551234
No authentication required for phone switch calls
Success Response:
{
"message": "Route error logged successfully",
"errorId": 123,
"routeId": 5,
"prefix": "1416",
"rate": 0.0150
}
Get error reports (Admin):
GET /api/routeerrors?route=idt-gold&days=7&page=1&pageSize=50
Authorization: Bearer YOUR_JWT_TOKEN
Get error summary (Admin):
GET /api/routeerrors/summary?days=7
Authorization: Bearer YOUR_JWT_TOKEN
Response Codes
Common HTTP Status Codes:
- 200 Success
- 400 Bad Request
- 401 Unauthorized
- 403 Forbidden
- 404 Not Found
- 500 Server Error
Error Response Format:
{
"error": "Error description",
"message": "Detailed message"
}