Designing APIs8% of the exam

Query parameters versus URI parameters

When a value belongs in the path as a URI parameter, in the query string as a query parameter, or in a header, how RAML 1.0 declares `uriParameters` and `queryParameters`, which mistakes API Designer flags, and how APIkit strict validation treats undeclared query parameters.

Official exam objective
Identify when and how to define query parameters vs URI parameters.

~7 min read · 6 practice questions ·

What the exam expects

  • Decide whether a value is a URI parameter (it identifies one resource), a query parameter (an optional filter on a list) or a header (credentials such as client_id and client_secret).
  • Declare uriParameters on the resource and queryParameters under the method in RAML 1.0, with type, required and example.
  • Match a request URL to a specification, and spot what API Designer flags: unused URI parameters and URI parameter values containing /.
  • Reject undeclared query parameters at runtime with APIkit's Query Parameters Strict Validations.
  • Key terms: URI parameter (a {name} placeholder in a resource path, filled with a value); query parameter (a name/value pair after ?); uriParameters (RAML node on a resource that describes its placeholders); queryParameters (RAML node on a method that describes its query string); strict validation (APIkit setting that accepts only declared query parameters or headers).

Key facts

Identifier
Detail
URI parameter in the path, as in /flights/{ID} (required string)
Optional filter
Detail
Query parameter, as in destination on GET /flights
Client credentials
Detail
Headers by default and recommended; query parameters pose security risks
uriParameters
Detail
Declared on the resource whose path holds {name}
queryParameters
Detail
Declared under the method, with type, required, example
Unused declared URI parameter
Detail
Warning: unused uri parameter
/ in a URI parameter value
Detail
Error: must not contain '/' character
Reject undeclared query parameters
Detail
queryParamsStrictValidation="true" on apikit:config
disableValidations="true"
Detail
Turns off query parameter and header validation to minimize latency
Sources for this section (5)
  • Why does the API Console's default Mocking Service return a success response even when client_secret is missing?
  • Which RAML node declares the id query parameter in the APIkit tutorial, and is it required?
  • Why does an APIkit Router that validates query parameters still not reject a call with a missing credential?
  • When the mocking service Try it form takes query parameters, in what form do you enter them?

The questions are free to read. Answers with their sources and self-grading are included with the pack.

Keep reading with the MuleSoft Developer pack

  • Core concepts
  • Exam traps
  • Worked scenario

The pack includes:

  • All 40 lessons of the MuleSoft Developer guide, with reading progress
  • Interactive decision walks and step-by-step sequence steppers
  • Practice exams purchase adds inline bank questions and topic practice (6 questions for this lesson)
  • An official source cited for every claim
  • An AI tutor that answers from the guide
  • Unlimited timed practice exams

Practice for the MuleSoft Developer exam