Bird
0
0

You want to build a dashboard showing daily API call counts and average response times grouped by endpoint for the last 30 days. Which API call best fits this need?

hard📝 Application Q15 of 15
Rest API - API Testing and Monitoring
You want to build a dashboard showing daily API call counts and average response times grouped by endpoint for the last 30 days. Which API call best fits this need?
AGET /api/metrics/daily?group=endpoint&fields=count,response_time_avg
BGET /api/metrics?start=2024-05-01&end=2024-05-30&group_by=endpoint&metrics=count,response_time_avg
CPOST /api/metrics with JSON body {"group_by":"endpoint","metrics":["count","response_time_avg"]}
DGET /api/metrics?date_range=last30days&group_by=endpoint
Step-by-Step Solution
Solution:
  1. Step 1: Identify required parameters

    We need a date range (last 30 days), grouping by endpoint, and metrics count and average response time.
  2. Step 2: Match API call to requirements

    GET /api/metrics?start=2024-05-01&end=2024-05-30&group_by=endpoint&metrics=count,response_time_avg uses GET with start/end dates, group_by=endpoint, and metrics=count,response_time_avg which fits perfectly.
  3. Step 3: Check other options

    POST /api/metrics with JSON body {"group_by":"endpoint","metrics":["count","response_time_avg"]} uses POST which is unusual for fetching metrics; A uses different parameter names not standard; D lacks metrics selection.
  4. Final Answer:

    GET /api/metrics?start=2024-05-01&end=2024-05-30&group_by=endpoint&metrics=count,response_time_avg -> Option B
  5. Quick Check:

    Date range + group_by + metrics = GET /api/metrics?start=2024-05-01&end=2024-05-30&group_by=endpoint&metrics=count,response_time_avg [OK]
Quick Trick: Use GET with start/end, group_by, and metrics parameters [OK]
Common Mistakes:
MISTAKES
  • Using POST instead of GET for data retrieval
  • Missing metrics parameter
  • Using incorrect parameter names

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes