Quick Start Guide
Prerequisites
- Python 3.8+
- MongoDB instance
- Environment variables configured
- JWT authentication service
Setup
- Clone and navigate to the evaluate service:
Authentication
Get JWT token from the Admin service authentication endpoints:
# Sign up
curl -X POST "https://admin.trydodo.xyz/api/users/signup" \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "password": "your-password"}'
# Login
curl -X POST "https://admin.trydodo.xyz/api/users/login" \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "password": "your-password"}'
First API Call
-
Test the health endpoint:
curl https://evaluate.trydodo.xyz/health -
Create an outcome:
-
Create an outcome:
curl -X POST "https://evaluate.trydodo.xyz/api/outcomes/upload" \
-H "Authorization: Bearer <your-jwt-token>" \
-H "Content-Type: application/json" \
-d '{
"decision_id": "test_decision_123",
"customer_id": "test_user",
"outcome": "success - test outcome"
}' -
Get statistics:
curl -X GET "https://evaluate.trydodo.xyz/api/stats/overall" \
-H "Authorization: Bearer <your-jwt-token>"
Workflow Example
1. Create Decision Outcome
curl -X POST "https://evaluate.trydodo.xyz/api/outcomes/upload" \
-H "Authorization: Bearer <jwt-token>" \
-H "Content-Type: application/json" \
-d '{
"decision_id": "decision_456",
"customer_id": "customer_123",
"outcome": "success - customer satisfied with recommendation"
}'
2. Get Decision Statistics
curl -X GET "https://evaluate.trydodo.xyz/api/stats/decision/decision_456" \
-H "Authorization: Bearer <jwt-token>"
3. Analyze Trends
curl -X GET "https://evaluate.trydodo.xyz/api/stats/trends?days=7" \
-H "Authorization: Bearer <jwt-token>"
4. Compare Performance
curl -X GET "https://evaluate.trydodo.xyz/api/stats/comparison?limit=5" \
-H "Authorization: Bearer <jwt-token>"
Common Use Cases
Monitoring Recommendation Performance
- Log outcomes from recommendation decisions
- Track success rates over time
- Compare different recommendation strategies
- Identify top-performing decision types
Quality Assurance
- Monitor data completeness and consistency
- Track error rates and response times
- Analyze outcome patterns
- Generate performance reports
Business Intelligence
- Analyze customer satisfaction trends
- Track decision effectiveness
- Monitor system performance metrics
- Generate executive summaries
Integration Examples
With Recommend Service
# After getting recommendations
recommendation_response = requests.post(
"https://recommend.trydodo.xyz/api/recommend",
headers={"Authorization": f"Bearer {token}"},
json=request_data
)
# Log the outcome
outcome_response = requests.post(
"https://evaluate.trydodo.xyz/api/outcomes/upload",
headers={"Authorization": f"Bearer {token}"},
json={
"decision_id": recommendation_response.json()["decision_id"],
"customer_id": customer_id,
"outcome": "success" if customer_purchased else "no_purchase"
}
)
Batch Processing
# Process multiple outcomes
outcomes = [
{
"decision_id": f"decision_{i}",
"customer_id": customer_id,
"outcome": f"outcome_{i}"
}
for i in range(10)
]
for outcome in outcomes:
response = requests.post(
"https://evaluate.trydodo.xyz/api/outcomes/upload",
headers={"Authorization": f"Bearer {token}"},
json=outcome
)
Next Steps
- Read the API Overview for detailed endpoint information
- Review Outcomes API for outcome management
- Explore Statistics API for analytics features
Troubleshooting
Common Issues
401 Unauthorized
- Check your JWT token is valid and not expired
- Ensure token is properly formatted in Authorization header
404 Not Found
- Verify the endpoint URL is correct
- Check that decision_id or outcome_id exists
500 Internal Server Error
- Check MongoDB connection
- Verify environment variables are set correctly
- Check server logs for detailed error information
Debug Mode
Enable debug logging by setting:
DEBUG=true
LOG_LEVEL=DEBUG
Health Checks
Monitor service health:
curl http://localhost:5049/health