DIY Exercise 3-1 - Create An API Specification With RAML
DIY Exercise 3-1 - Create An API Specification With RAML
Objectives
In this exercise, you create an API specification using RAML. You will:
• Appropriately specify GET and POST methods.
• Appropriately define URI parameters, query parameters, and headers.
• Restrict possible values using an enumeration.
Scenario
Your company needs to expose a customer accounts database as a System API for the rest of the
organization. The first step is to create the RAML specification and post it to your company’s private
Anypoint Exchange so all stakeholders can review and provide feedback. This RAML specification
needs to separate out data type definitions from the main API RAML file into separate reusable RAML
files.
1
• The /accounts resource has a POST method that accepts an array of Account objects (with no
id and no creationDate field) in JSON format and returns a JSON message: {"message":
"Account created (but not really)"}. This Account object is represented as a new data type that
does not have id or creationDate fields, makes the type field required, and has a corresponding
example.
• Each method should have a description.
• Each method should have a custom 400 error status message example in JSON format.