Designing APIs8% of the exam
REST methods and nested RAML resources
Which HTTP method (GET, POST, PUT, PATCH, DELETE) and which resource path fit a requirement, how RAML nests resources and places methods under them, and what the API Designer text editor gives you before any Mule application exists.
Use REST API methods and resources.
~8 min read · 9 practice questions ·
What the exam expects
- Choose GET, POST, PUT, PATCH or DELETE and the matching collection or item path from a requirement such as "create an order whose ID the back end assigns" or "change one field only".
- Read a RAML 1.0 specification and work out the full request path served by a method declared under nested resources.
- Place a method correctly in RAML: as a key under the resource it acts on, beside any nested resources.
- Predict the result of a request for an undeclared path or method, and know what API Designer needs before a call can be tried.
- Key terms: resource (a RAML key starting with
/, such as/flights); nested resource (a resource declared inside another, whose path extends the parent's); collection (the resource for the whole set, such as/flights); item (one member addressed by ID, such as/flights/123); method (the HTTP verb declared under a resource).
Key facts
POST
- Detail
- Creates a new resource, sent to the collection (
POST /flights)
PUT
- Detail
- Updates an existing resource; used for the entire record
PATCH
- Detail
- Updates only part of a resource
Nested resource path
- Detail
/userbyidunder/usersis served at/users/userbyid
Method placement
- Detail
- Method keys sit under their resource, beside nested resources
Undeclared path
- Detail
APIKIT:NOT_FOUND, scaffolded as 404
Undeclared method on a declared resource
- Detail
APIKIT:METHOD_NOT_ALLOWED, scaffolded as 405
New project default
- Detail
- RAML 1.0, changeable to RAML 0.8 or OAS; projects can mix file types
Download as another format
- Detail
- Not guaranteed to be valid
Mocking prerequisite
- Detail
- At least one endpoint, each with at least one method; no Exchange publish needed
Sources for this section (5)
- Examine APIs and Web Servicestrailhead.salesforce.com (opens in a new tab)
- Building, Implementing, and Testing a REST APIdocs.mulesoft.com (opens in a new tab)
- APIkit for REST Error Handling Referencedocs.mulesoft.com (opens in a new tab)
- Create an API Specification with the Text Editordocs.mulesoft.com (opens in a new tab)
- Simulate API Calls with the Mocking Servicedocs.mulesoft.com (opens in a new tab)
- Why is the scaffolded flow for the tutorial's nested resource named
get:\users\userbyid:api-config? - Which specification languages can API Designer design besides RAML?
- Which path serves a
get:declared under/userbyid:, which is nested under/users:? - When a project holds more than one specification file, what must you set?
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 (9 questions for this lesson)
- An official source cited for every claim
- An AI tutor that answers from the guide
- Unlimited timed practice exams