API testing

Validate a bad-request (400) body

Medium70 pts~25 min
  • 400 Bad Request
  • Validation
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/api-testing-validate-a-bad-request-400-body

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

Objective

Send an empty create request and validate every part of the 400 error body.

Your task

  1. 1POST BASE_URL + "/users" with {}.
  2. 2Assert 400 and error.code === "VALIDATION_ERROR".
  3. 3Assert error.message is a string and error.fields contains both name and email.

Acceptance criteria

  • POST /users returns 400
  • At least 3 assertions pass

Fixtures

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

API testing · API Testing · Authorization & negative testing