
Design APIs using RAML 1.0 with Mule 4 by learning REST concepts, defining resources and methods, and detailing requests, responses, data types, and security schemes.
Learn how an API acts as a contract between applications, handling requests and responses in JSON or XML, and explore API providers, consumers, specifications, and microservices.
Define the use case for BookMyHotel where travelers register, search hotels by city, state, or country, and book, linked via Mule ESB to multiple hotels and the travel firm's database.
Learn REST principles and RAML 1.0 to design a resource-based API for a travel use case. Identify collections like registrations, hotels, and bookings and map actions to HTTP methods.
Explore Design Center within the Anypoint platform to create and publish RAML 1.0 API specifications and fragments using the API Designer, then share via Exchange and mock for validation.
Navigate the Anypoint design center to create a RAML 1.0 API specification project named BookMyHotelAPI, exploring the root RAML, resources, methods, and API console testing.
Sign up for the Anypoint platform, log in, visit Design Center, and create an API specification project, using the attached lab document to complete all steps.
Import the API specification from the resources zip into the design center to create a BookMyHotelAPIReference REST API. Replace files on subsequent imports to update the root RAML.
Define RAML resources with API designer, detailing registrations, hotels, and bookings, including baseUri, resource paths, and complete URIs like http://bookmyhotel.com/registrations.
Define the base uri and set resource paths for registrations, hotels, and bookings in RAML 1.0, including nested resources like /registrations/{registrationId}, /hotels/{hotelId}, and /hotels/{hotelId}/bookings.
Map actions to http methods for resources using get for listings and post for creation. Use patch to update and delete to remove registrations, hotels, and bookings.
Define methods for resources in the root RAML file, including registrations, hotels, and bookings, with appropriate get post and patch delete variants.
Define media type to represent resources in rest APIs, choosing formats like application/json or application/xml per RFC 6838. Use default or explicit media types to govern request and response bodies.
Define media type in RAML using mediaType to support JSON and XML representations for requests and responses; apply it at the root for all resources.
Explore defining query parameters in RAML 1.0 to filter a hotels list by city, state, and country using the get method and a sample URI.
Define query parameters for the hotels resource's get method in RAML, making city, state, and country optional and enabling constraints like default, length, and pattern.
Design a RAML 1.0 API for BookMyHotelAPI by setting the base URI, defining resources and methods, applying application/json, and adding query parameters for the hotels collection.
Define request and response for RAML methods, including when post and patch require a body, when get/delete omit it, plus query parameters, headers, and http status codes.
Specify request and response bodies for RAML 1.0 methods on the registrations resource, detailing get, post, patch, and delete flows, status codes, and media types such as application/json and application/xml.
Explain HTTP error responses by distinguishing client (4xx) and server (5xx) errors. Use 404 for get and delete, and 500 for post and patch in RAML API design.
Define HTTP status codes in RAML 1.0 for the registrations resource, including 404 and 500 with optional error bodies, across get, post, patch, and delete methods.
Specify request bodies for post and patch, define http status codes and responses, show 200 with a body for get, and handle error statuses.
Define RAML headers for accept and content-type to govern requests and responses, and apply location and content-type headers for get, post, patch, and delete.
Define headers in RAML for the registrations resource, including accept and content-type. Specify json and xml media types, and 200, 201, 404, 500 responses with a location header.
Define headers in RAML specifications for a Mule 4 API, covering accept and content-type request headers for get, delete, post, and patch methods, plus location and content-type response headers.
Explore data types in RAML, showing how error data types enforce code, reasonPhrase, and details, and how built-in and custom data types—scalar, object, array, union—are defined and extended with facets.
Learn how facets configure RAML 1.0 data types, including description, default, enum, and example, with integer, string, object, and array constraints.
Learn to define and reuse data types with RAML 1.0 data type fragments, including error, address, and room types, and use the include tag to build modular, readable API specs.
Create and organize RAML data type fragments by modeling errors, addresses, rooms, and hotels, and learn to use include, array, and object definitions with proper indentation.
Import a data type zip into the BookMyHotelAPI project, overwrite fragments with included data type fragments, and define registrations endpoints with get, post, patch, and delete methods and error responses.
Create and use data types, including error, address, and registration fragments, in the root RAML specification. Describe request and response bodies for registrations and nested resources with error handling.
Create example fragments for data type declarations using the example facet or examples facet, included with the include tag, to improve API documentation and readability for consumers.
Create example fragments for RAML 1.0 by adding an examples folder, building error and booking example fragments, and duplicating booking variants with updated IDs, dates, and amenities.
Import remaining example fragments from the examples.zip file, replace existing files, and organize error, booking, registration, and hotel examples using the examples facet and include directives.
Create an error example fragment and embed it in the error data type fragment, then import remaining fragments from the zip file and integrate them into booking data type fragments.
Learn how the mocking service simulates an API specification, delivering test links with http status codes and example payloads for testing in browser, postman, or API designer and exchange.
Learn how to configure and use Mule 4's mocking service, toggle between base URI and mocking service, and manage public links and expiration for external testing.
Demonstrates testing a registrations API with a mocking service, validating get and post methods, headers such as Accept and content-type, and responses like 200, 201, 400, and 415.
Demonstrate testing the registration resource's get method with a mocking service, validating the uri parameter registrationId, and inspecting a JSON 200 ok response per RAML examples.
Test api endpoints using a public mocking service with Postman, validating get and post on registrations and inspecting 200 responses, 201 creation, and the location header.
Practice testing a mocking service by validating the get and post methods of the registrations resource, configure the mocking service, and test from outside the API designer with Postman.
Define documentation fragments to keep API documentation readable and expandable, using the documentation node in the root RAML file and include fragments like BookMyHotel.raml.
Learn to create and use a RAML 1.0 documentation fragment by making a documentation folder, creating BookMyHotelDoc.raml with a title and content, and including it in the root RAML file.
Learn how display name and description improve API readability in RAML 1.0, and see how to specify them for resources and methods within the RAML grammar.
Define display name and description for resources, methods, and data types within a RAML 1.0 API, using the registrations resource, get and post methods, and registration data type.
Work through a documentation-focused lab by creating a documentation fragment, integrating it into the root RAML file, and defining display names and descriptions for resources and methods.
Explore how resource types reduce RAML clutter by abstracting get and post patterns, using reserved parameters like resourcePath and resourcePathName, and applying functions such as uppercamelcase.
Learn to design API resources with RAML 1.0 resource types, applying parameters and functions like resourcePathName, singularize, and uppercamelcase, and explore inheritance and get and post methods.
Define resource type fragments for collection resources using resourcePathName, uppercamelcase, and singularize; include them in the root RAML and enable optional get, post methods with query parameters.
Define and apply a member resource type fragment for nested resources in RAML 1.0. Reuse it across registration and other resources, make methods optional, and reduce repetitive code.
Create collection and member resource type fragments, integrate them into the root RAML file and specifications, and optionally set display names and descriptions in collection and member fragments.
Learn to create reusable traits by identifying patterns in method definitions, including reserved parameters like methodName, and apply them across resources and methods in RAML 1.0.
Create trait fragments for accept header and error responses in RAML 1.0, then include them in the root RAML and parameterize errors with errorCode.
Apply traits to get, post, patch, and delete methods in RAML resource type fragments, using hasError and hasAcceptHeader with errorCode values like 404 and 500.
Create trait fragments for the accept header and error response, then include them in the root RAML specification and apply to the collection and member resource type fragments.
Explore RAML libraries and library fragments, as collections of declarations—data types, resource types, and traits—enabling modular, reusable API definitions.
Create library fragments for data types, resource types, and traits in RAML, including hasAcceptHeader and hasError, and use include tags to assemble DataTypesLibrary, ResourceTypesLibrary, and TraitsLibrary for future reuse.
Learn to define and use RAML libraries by configuring uses nodes for traits, resource types, and data types, and access library items with libraryName.item.
Create library fragments for traits, data types, and resource types; define libraries in the root RAML file; use libraries to define items and update fragments.
Learn to share your API specification project in the design center, assign viewer, editor, or admin access, and control who can view, edit, or share the BookMyHotelAPI.
Share the project by inviting users via email and assigning viewer, editor, or admin access from design center or the project page.
Share and manage api specifications in design center by assigning viewer, editor, and admin rights, editing the RAML file, and saving media type changes across collaborators.
Remove a user's access via the share project dialog, save changes, and sign out. Sign in as that user to verify they no longer have BookMyHotelAPI project in Design Center.
Design and share an API specification in the design center using the BookMyHotelAPI, then log in as other users to interact with the shared project and complete the lab.
Explore Anypoint Exchange as a catalog of reusable assets, publish REST APIs and API spec fragments, and share them across organizations to boost collaboration and reuse.
Navigate Anypoint Exchange to discover, filter, and publish assets; view API details and versions; test endpoints, share feedback, and manage internal collaboration.
Publish and consume api fragments, including the error data type fragment from the library, via exchange, and reuse it in BookMyHotelAPI.
Publish an api fragment in design center, create the error data type fragment and error example in the examples folder, then publish to exchange with asset version 1.0.0 in development.
Publish a new version of the error api fragment from 1.0.0 to 1.0.1, then update the consuming BookMyHotelAPI project to use the latest fragment version.
Publish an api fragment to exchange, create the api fragment project, then publish to exchange; later, consume the api fragment from the exchange via the api specification project.
Publish BookMyHotelAPI to exchange by setting asset version 1.0.0 and API version V1, then publish in development. Add markdown documentation and test endpoints using the mocking service.
Share BookMyHotelAPI in exchange with organization members or external users, assigning viewer, contributor, or administrator rights, and optionally publish to the public portal for external access.
Share BookMyHotelAPI with users in your organization via access management and the exchange, selecting collaborators and assigning viewer, contributor, or admin rights.
Publish BookMyHotelAPI to the public portal by selecting v1 in the public tab, and promote the dependent assets, including the error API fragment, to stable before finalizing the publish.
Share a raml 1.0 api to the public portal, view version v1, examine endpoints and methods, test with mocking, and unpublish the api from the public portal.
Learn to share and reuse API fragments in Mule 4 with RAML 1.0, through design center and exchange, enabling reuse of request, response structures and error fragments.
Publish the BookMyHotelAPI to exchange, then share it with specific users, everyone in the organization, and finally to the public portal, following the lab steps.
What this course will teach?
· API Design with RAML 1.0 using API Designer of Anypoint Platform
· Test using Mocking Service.
· Publish API to Exchange and Public Portal.
Details of what will you learn?
· We will first look into UseCase
· Identify Resources as per the UseCase
· Define methods for these resources (Get,Post,Delete etc)
· Define Query Parameters for Request
· Define Headers for Request and Response
· Model Data using DataTypes
· Use DataTypes to define Request and Response
· Add Documentation in the API
· Create ResourceTypes and Traits for handling repeatable patterns in API
· Modularize our API using library
· Test our API using Mocking Service (without any implementation)
· Publish API to Anypoint Exchange to share within Organization
· Publish API to Public Portal to share with External Users
. Use Security Schemes
· Version APIs, Change Versions
. Overview of using Anypoint studio to create API design
What this course does not cover?
· API Implementation using Anypoint Studio is not part of this course
Who this course is for ?
· This course is for any Mule developer who wants to get introduced to API Design with RAML 1.0 using API Designer
· At the end of my course, students will be able to start designing API using RAML 1.0