🎫 ServiceNow Mock API
Base path: /servicenow
Health check endpoint
Example:
curl http://api.matthewcalabresi.com/servicenow/health
Get P1/P2 incidents in chatbot-friendly format
Query Parameters:
priority=1,2 (default: 1,2)
state=1,2,3,6,7
include_closed=true/false (default: false)
Example:
curl "http://api.matthewcalabresi.com/servicenow/api/chatbot/priority-incidents?priority=1&include_closed=false"
Analyze incident and prepare data for New Relic correlation
Request Body:
{"ticket_id": "INC1234567"}
Example:
curl -X POST http://api.matthewcalabresi.com/servicenow/api/chatbot/incident-analysis -H "Content-Type: application/json" -d '{"ticket_id": "INC1234567"}'
Get dashboard overview with incident counts and summaries
Example:
curl http://api.matthewcalabresi.com/servicenow/api/chatbot/dashboard
List incidents with ServiceNow query syntax
Query Parameters:
sysparm_query (e.g., "priority=1^active=true")
sysparm_limit (default: 100)
sysparm_offset (default: 0)
sysparm_display_value (true/false)
Example:
curl "http://api.matthewcalabresi.com/servicenow/api/now/table/incident?sysparm_query=priorityIN1,2^active=true"
Get incident by ticket number (e.g., INC1234567)
Example:
curl http://api.matthewcalabresi.com/servicenow/api/now/table/incident/by-number/INC1234567
Get incident by sys_id
Example:
curl http://api.matthewcalabresi.com/servicenow/api/now/table/incident/abc123
Create a new incident
Request Body:
{
"short_description": "Server outage",
"priority": "1",
"business_service": "Web Frontend"
}
List all users
Example:
curl http://api.matthewcalabresi.com/servicenow/api/now/table/sys_user
List all configuration items
Example:
curl http://api.matthewcalabresi.com/servicenow/api/now/table/cmdb_ci
📊 New Relic Mock API
Base path: /newrelic
Health check endpoint
Example:
curl http://api.matthewcalabresi.com/newrelic/health
Correlate ServiceNow ticket with New Relic metrics and infrastructure data
Request Body:
{
"ticket_id": "INC1234567",
"service_affected": "user-service",
"opened_at": "2024-01-15T10:30:00Z",
"closed_at": "2024-01-15T12:45:00Z"
}
Example:
curl -X POST http://api.matthewcalabresi.com/newrelic/v2/correlate -H "Content-Type: application/json" -d '{
"ticket_id": "INC1234567",
"service_affected": "user-service",
"opened_at": "2024-01-15T10:30:00Z"
}'
List all monitored applications
Example:
curl http://api.matthewcalabresi.com/newrelic/v2/applications
Get specific application details
Example:
curl http://api.matthewcalabresi.com/newrelic/v2/applications/app_001
Get time-series metrics for an application
Query Parameters:
start_time (required, ISO 8601)
end_time (required, ISO 8601)
names (optional, metric names)
Example:
curl "http://api.matthewcalabresi.com/newrelic/v2/applications/app_001/metrics?start_time=2024-01-15T10:00:00Z&end_time=2024-01-15T12:00:00Z&names=response_time&names=error_rate"
Get service status history (for incident correlation)
Query Parameters:
start_time (required, ISO 8601)
end_time (required, ISO 8601)
service (optional, specific service name)
Example:
curl "http://api.matthewcalabresi.com/newrelic/v2/applications/app_002/status-history?start_time=2024-01-15T10:00:00Z&end_time=2024-01-15T12:00:00Z"
Get current alerts
Query Parameters:
severity (optional: critical, warning, info)
state (default: open)
Example:
curl "http://api.matthewcalabresi.com/newrelic/v2/alerts?severity=critical&state=open"
Get deployment and infrastructure events
Query Parameters:
start_time (optional, ISO 8601)
end_time (optional, ISO 8601)
Example:
curl "http://api.matthewcalabresi.com/newrelic/v2/events?start_time=2024-01-15T00:00:00Z"
Get infrastructure component status
Example:
curl http://api.matthewcalabresi.com/newrelic/v2/infrastructure
Get error tracking data
Query Parameters:
app_id (optional)
start_time (optional, ISO 8601)
end_time (optional, ISO 8601)
Example:
curl http://api.matthewcalabresi.com/newrelic/v2/errors
Get AI-generated insights about system performance
Query Parameters:
app_id (optional)
Example:
curl http://api.matthewcalabresi.com/newrelic/v2/insights
🤖 Complete Chatbot Integration Example
End-to-end workflow for correlating ServiceNow incidents with New Relic data:
Step 1: Get P1/P2 Incidents
curl http://api.matthewcalabresi.com/servicenow/api/chatbot/priority-incidents
Step 2: Analyze Specific Incident
curl -X POST http://api.matthewcalabresi.com/servicenow/api/chatbot/incident-analysis -H "Content-Type: application/json" -d '{"ticket_id": "INC1234567"}'
Step 3: Get Correlated New Relic Data
curl -X POST http://api.matthewcalabresi.com/newrelic/v2/correlate -H "Content-Type: application/json" -d '{
"ticket_id": "INC1234567",
"service_affected": "user-service",
"opened_at": "2024-01-15T10:30:00Z",
"closed_at": "2024-01-15T12:45:00Z"
}'
Result:
Your chatbot now has:
- ServiceNow incident details (priority, status, assigned to, etc.)
- New Relic metrics during the incident window
- Service status history
- Related alerts
- Baseline vs incident performance comparison