API testing

Send path parameters

Easy30 pts~12 min
  • Path parameters
  • URL templates
Practice app · Acme REST API

A live REST + GraphQL API with auth, validation, pagination, rate limiting and an interactive request console.

BASE_URL
/api/practice
Console app
/lab/qa-automation-send-path-parameters

Your starter code already declares BASE_URL — call the API relative to it.

Objective

Build URLs from path templates instead of string concatenation and assert each resolved resource.

Your task

  1. 1Request BASE_URL + "/users/{id}" with id = 2 via a path parameter; assert name "Alan Turing".
  2. 2Request BASE_URL + "/status/{code}" with code = 418; assert status 418 and body.status === 418.
  3. 3Keep the template and the values separate in your code.

Acceptance criteria

  • GET /users/2 returns 200
  • GET /status/418 returns 418
  • At least 2 assertions pass

Fixtures

apiKey
tqa_live_key_123
basicUser
admin
basicPassword
secret
username
qa@target.dev
password
Test@123

API testing · QA Automation · Requests & methods