SlideShare a Scribd company logo
08th Jan 2022
11:00 IST (GMT+05:30)
Engineering Student MuleSoft Meetup Group
API DESIGN USING RESTFUL API MODELING
LANGUAGE (RAML)
Safe Harbour Statement
● Both the speaker and the host are organizing this meet-up in individual capacity only. We are not
representing our companies here.
● This presentation is strictly for learning purposes only. Organizer/Presenter do not hold any
responsibility that same solution will work for your business requirements.
● This presentation is not meant for any promotional activities.
2
A recording of this meetup will be uploaded to events page within 24 hours.
Questions can be submitted/asked at any time in the Chat/Questions & Answers Tab.
Make it more Interactive!!!
Give us feedback! Rate this meetup session by filling feedback form at the end of the day.
We Love Feedbacks!!! Its Bread & Butter for Meetup.
Housekeeping
3
Organizers
4
Jitendra Bafna Deepesh Dubey Nitish Raj Ravi Tamada
Speaker
5
Nitish Raj
6
● What is RAML and its basic
○ Resource, Query and URI Parameter, HTTP Status Codes
● Examples
● Data Types
● Traits
● Security Schemes
● Resource Types
● Library
● Fragments
● Q&A
● Trivia Quiz
Agenda
API Design With RAML
8
Why you need RAML?
9
RAML Basics
Stands for RESTful API Modeling
Language
Language to define specification for HTTP
based APIs
Based on YAML
Used to create a mutual
contract between API
Consumer and API
provider which defines
Resource(s)
Request
Response
Security
10
Query Params and URI Params
Query Params URI Params
Used to sort/ filter on a given set of resource (records) Used to access a specific resource (record)
Example:
Find employees whose designation are workers.
Example:
Find distinct employee from employee database, using
employeeId.
https://www.abcbak.com/employees?designation=worker
https://www.abcbank.com/employees?key=value
Accessed using question mark ? and ampersand &
https://www.abcbak.com/employees/12345
https://www.abcbank.com/employees/{employeeId}
Accessed using curly braces {}
11
HTTP Methods and Response Codes
HTTP Methods Description Example Response Code
GET Fetch resources (records) from a given set
of resource
Fetch employees from employee
database
200
POST Create a new resource (record) in a given
set of resource
Insert a new employee in employee
database
201
PUT Create or Update an existing/ new
resource
Updating an employee details 200/ 201
PATCH Update an existing resource (record) Updating an employee salary 200
DELETE Delete an existing resource (record) Deleting an employee 200
HTTP Response Status Codes
Informational responses 1xx 100-199
Successful responses 2xx 200-299
Redirection messages 3xx 300-399
Client error responses 4xx 400-499
Server error responses 5xx 500-599
HTTP Error Response Status Codes
401 Unauthorized
404 Not Found
500 Internal Server Error
502 Bad Gateway
503 Service Unavailable
Demonstration
13
Design Center Navigation
● Sign up for a 30 days free trial Anypoint Platform account
https://anypoint.mulesoft.com/login/signup or just follow https://docs.mulesoft.com/access-
management/managing-your-account
● Login to your account and click on three dashes on extreme up left on home page to show
options.
1
2
14
Examples
Examples are dummy responses across your API HTTP methods. For example: Success response, error
response etc.
RAML
Based
JSON
Based
Usage
15
Data Types
● Data types are used for describing data for its validation against type declaration.
● Example:
○ employeeId should be of integer type
○ employeeName should be of string type
16
Traits
Traits are reusable components to help define common attributes for HTTP methods such as cacheable,
filterable, searchable, pageable etc.
Apart from serving above purpose, A trait can be designed for almost each and every feature such as a
response, queryParams, headers etc.
Define
Include
Use
17
Security Schemes
It is a mechanism to secure data access, identify requests, and determine access level and data visibility
at resource, method or even root RAML file level
Type Description
OAuth 1.0 The API authentication requires using OAuth 1.0 as described in RFC5849
OAuth 2.0 The API authentication requires using OAuth 2.0 as described in RFC6749
Basic Authentication
The API authentication relies on using Basic Access Authentication as described
in RFC2617
Digest Authentication
The API authentication relies on using Digest Access Authentication as described
in RFC2617
Pass Through
Headers or query parameters are passed through to the API based on a defined
mapping.
x-{other} The API authentication relies on another authentication method.
18
Resource Types
Resource types help to reduce/ eliminate frequent repetitive declarations of resources, methods etc. by
using dynamic placeholders.
● Used to define reusable patterns for
○ Resources
○ Methods
● Advantages
○ Consistency
○ Reduces complexity
○ Less code
19
Library
● RAML libraries are used to combine any collection of
○ Data type
○ Resource type
○ Trait
○ Security scheme
into modular, externalized, reusable groups.
It can be defined as an external library and can be included in wherever required.
20
Fragments
Reusable RAML documents/ snippets that can be used across API Specs as dependencies from Anypoint
Exchange or external file/ folder. A fragment is an independent component that can be created and
published on Anypoint Exchange.
• Trait
• Resource Type
• Library
• Type
• User Documentation
• Example
• Annotation Type
• Security Scheme
Q&A
Quiz Time
23
Question 1
RAML Stands for
A. RESTful API Modeling Language
B. Reserved API Modeling Language
C. Routing API Modeling Language
D. ReactJS API Modeling Language
24
Question 2
Which parameter is most suitable and standard way to access a specific/ distinct resource (record) from a
collections of resources.
A. Query Parameter (?key=value)
B. URI Parameter (/{})
25
Question 3
Which of below is correct option to use example(s) from examples folder in a root RAML file
A. #import examples/employeeExamples.raml
B. #include examples/employeeExamples.raml
C. !include examples/employeeExamples.raml
D. @use examples/employeeExamples.raml
26
Question 4
A Fragment can be published/ deployed to Anypoint Exchange independently without being included in
Any API Specification.
A. True
B. False
27
Bonus question
Did you enjoy today’s session?
Drop a feedback once you receive an official email after this meetup. Also, Send us a note on LinkedIn.
Thank you

More Related Content

PDF
MuleSoft Surat Virtual Meetup#28 - Exposing and Consuming SOAP Service - SOAP...
PPT
JDBC Connectivity Model
PPT
PPT
JDBC Architecture and Drivers
PPTX
Java.sql package
PDF
Spring Integration: from XML to Java DSL
PPTX
Power of Transformation with DataWeave 2.X Engine
MuleSoft Surat Virtual Meetup#28 - Exposing and Consuming SOAP Service - SOAP...
JDBC Connectivity Model
JDBC Architecture and Drivers
Java.sql package
Spring Integration: from XML to Java DSL
Power of Transformation with DataWeave 2.X Engine

What's hot (18)

PPT
Mule anypoint data gateway
PPT
PPTX
Spring integration with the Java DSL
PDF
Database and Java Database Connectivity
DOC
jdbc document
PPT
PPT
PPT
PPSX
JDBC: java DataBase connectivity
PPTX
Java- JDBC- Mazenet Solution
PPTX
Jdbc_ravi_2016
PPTX
Interface callable statement
PPT
Basic Java Database Connectivity(JDBC)
PDF
Overview Of JDBC
PPS
Jdbc architecture and driver types ppt
PPTX
java Jdbc
Mule anypoint data gateway
Spring integration with the Java DSL
Database and Java Database Connectivity
jdbc document
JDBC: java DataBase connectivity
Java- JDBC- Mazenet Solution
Jdbc_ravi_2016
Interface callable statement
Basic Java Database Connectivity(JDBC)
Overview Of JDBC
Jdbc architecture and driver types ppt
java Jdbc
Ad

Similar to Engineering Student MuleSoft Meetup#2 - API Design Using Restful API Modeling Language (RAML) (20)

PPTX
mulesoft birmingham meetup_api_designing_with_raml
PPTX
Faridabad Mulesoft Meetup Oct 10
PPTX
The ins and outs of RAML
PPTX
MuleSoft Surat Virtual Meetup#9 - RAML Reusability and Simplified
PPTX
Mule soft RAML API Designing
PDF
PDF
RAML BASED REST API with Mulesoft anypoint
PPTX
Mule soft meetup_4_mty_online_oct_2020
PPTX
Design API using RAML - basics
PPTX
Deep Dive into REST API Development | MuleSoft Mysore Meetup #16
PPTX
Raml part 2
PPTX
Restful api modeling language
PDF
MuleSoft Manchester Meetup #3 slides 31st March 2020
PDF
Faridabad MuleSoft Meetup Group (1).pdf
PPTX
Rest With Raml
PPTX
Raml part 1
PDF
ApiAddicts Meetup Sept 2016, Madrid
PDF
Mulesoft Online Training.pdf
PDF
Second meetup slidess
PPTX
#7 Deep Dive into RAML 1.0 .pptx
mulesoft birmingham meetup_api_designing_with_raml
Faridabad Mulesoft Meetup Oct 10
The ins and outs of RAML
MuleSoft Surat Virtual Meetup#9 - RAML Reusability and Simplified
Mule soft RAML API Designing
RAML BASED REST API with Mulesoft anypoint
Mule soft meetup_4_mty_online_oct_2020
Design API using RAML - basics
Deep Dive into REST API Development | MuleSoft Mysore Meetup #16
Raml part 2
Restful api modeling language
MuleSoft Manchester Meetup #3 slides 31st March 2020
Faridabad MuleSoft Meetup Group (1).pdf
Rest With Raml
Raml part 1
ApiAddicts Meetup Sept 2016, Madrid
Mulesoft Online Training.pdf
Second meetup slidess
#7 Deep Dive into RAML 1.0 .pptx
Ad

More from Jitendra Bafna (20)

PDF
MuleSoft Surat Meetup#55 - Unleash the power of Anypoint MQ
PDF
MuleSoft Surat Meetup#54 - MuleSoft Automation
PDF
MuleSoft Surat Meetup#53 - MuleSoft for Clinical Trial Modernization
PDF
MuleSoft Surat Meetup#52 - Flex Gateway (Port Based Routing V/S Path Based Ro...
PDF
MuleSoft Surat Meetup#51 - API Monitoring - Through a New Lens
PDF
Engineering Student MuleSoft Meetup#7 - Leveraging MuleSoft Service in Salesf...
PDF
MuleSoft Nashik Meetup#7 - Building FHIR applications in MongoDB using MuleSoft
PDF
MuleSoft Surat Meetup#50 - Ask the MuleSoft Ambassadors + CloudHub 2.0 Overvi...
PDF
MuleSoft Surat Meetup#49 - Robotic Process Automation - Why, Where, When and ...
PDF
MuleSoft Surat Meetup#48 - Anypoint API Governance (RAML, OAS and Async API) ...
PDF
MuleSoft Surat Meetup#47 - Error Handling With MuleSoft
PDF
MuleSoft Surat Meetup#46 - Deep Dive into MUnit With MuleSoft
PDF
MuleSoft Surat Meetup#45 - Anypoint Flex Gateway as a Kubernetes Ingress Cont...
PDF
MuleSoft Surat Meetup#44 - Anypoint Flex Gateway Custom Policies With Rust
PDF
Engineering Student MuleSoft Meetup#6 - Basic Understanding of DataWeave With...
PDF
MuleSoft Nashik Meetup#5 - JSON Logger and Externalize Logs
PDF
MuleSoft Surat Meetup#43 - Combine Service Mesh With Anypoint API Management ...
PDF
Engineering Student MuleSoft Meetup#5 - Error Handling With MuleSoft
PDF
MuleSoft Surat Meetup#42 - Runtime Fabric Manager on Self Managed Kubernetes ...
PDF
MuleSoft Surat Meetup#41 - Universal API Management, Anypoint Flex Gateway an...
MuleSoft Surat Meetup#55 - Unleash the power of Anypoint MQ
MuleSoft Surat Meetup#54 - MuleSoft Automation
MuleSoft Surat Meetup#53 - MuleSoft for Clinical Trial Modernization
MuleSoft Surat Meetup#52 - Flex Gateway (Port Based Routing V/S Path Based Ro...
MuleSoft Surat Meetup#51 - API Monitoring - Through a New Lens
Engineering Student MuleSoft Meetup#7 - Leveraging MuleSoft Service in Salesf...
MuleSoft Nashik Meetup#7 - Building FHIR applications in MongoDB using MuleSoft
MuleSoft Surat Meetup#50 - Ask the MuleSoft Ambassadors + CloudHub 2.0 Overvi...
MuleSoft Surat Meetup#49 - Robotic Process Automation - Why, Where, When and ...
MuleSoft Surat Meetup#48 - Anypoint API Governance (RAML, OAS and Async API) ...
MuleSoft Surat Meetup#47 - Error Handling With MuleSoft
MuleSoft Surat Meetup#46 - Deep Dive into MUnit With MuleSoft
MuleSoft Surat Meetup#45 - Anypoint Flex Gateway as a Kubernetes Ingress Cont...
MuleSoft Surat Meetup#44 - Anypoint Flex Gateway Custom Policies With Rust
Engineering Student MuleSoft Meetup#6 - Basic Understanding of DataWeave With...
MuleSoft Nashik Meetup#5 - JSON Logger and Externalize Logs
MuleSoft Surat Meetup#43 - Combine Service Mesh With Anypoint API Management ...
Engineering Student MuleSoft Meetup#5 - Error Handling With MuleSoft
MuleSoft Surat Meetup#42 - Runtime Fabric Manager on Self Managed Kubernetes ...
MuleSoft Surat Meetup#41 - Universal API Management, Anypoint Flex Gateway an...

Recently uploaded (20)

PPTX
Big Data Technologies - Introduction.pptx
PPTX
Machine Learning_overview_presentation.pptx
PDF
Encapsulation theory and applications.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
sap open course for s4hana steps from ECC to s4
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
A Presentation on Artificial Intelligence
PDF
Approach and Philosophy of On baking technology
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
Big Data Technologies - Introduction.pptx
Machine Learning_overview_presentation.pptx
Encapsulation theory and applications.pdf
Unlocking AI with Model Context Protocol (MCP)
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Electronic commerce courselecture one. Pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
sap open course for s4hana steps from ECC to s4
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Review of recent advances in non-invasive hemoglobin estimation
Building Integrated photovoltaic BIPV_UPV.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Machine learning based COVID-19 study performance prediction
Diabetes mellitus diagnosis method based random forest with bat algorithm
A Presentation on Artificial Intelligence
Approach and Philosophy of On baking technology
MIND Revenue Release Quarter 2 2025 Press Release
“AI and Expert System Decision Support & Business Intelligence Systems”

Engineering Student MuleSoft Meetup#2 - API Design Using Restful API Modeling Language (RAML)

  • 1. 08th Jan 2022 11:00 IST (GMT+05:30) Engineering Student MuleSoft Meetup Group API DESIGN USING RESTFUL API MODELING LANGUAGE (RAML)
  • 2. Safe Harbour Statement ● Both the speaker and the host are organizing this meet-up in individual capacity only. We are not representing our companies here. ● This presentation is strictly for learning purposes only. Organizer/Presenter do not hold any responsibility that same solution will work for your business requirements. ● This presentation is not meant for any promotional activities. 2
  • 3. A recording of this meetup will be uploaded to events page within 24 hours. Questions can be submitted/asked at any time in the Chat/Questions & Answers Tab. Make it more Interactive!!! Give us feedback! Rate this meetup session by filling feedback form at the end of the day. We Love Feedbacks!!! Its Bread & Butter for Meetup. Housekeeping 3
  • 4. Organizers 4 Jitendra Bafna Deepesh Dubey Nitish Raj Ravi Tamada
  • 6. 6 ● What is RAML and its basic ○ Resource, Query and URI Parameter, HTTP Status Codes ● Examples ● Data Types ● Traits ● Security Schemes ● Resource Types ● Library ● Fragments ● Q&A ● Trivia Quiz Agenda
  • 9. 9 RAML Basics Stands for RESTful API Modeling Language Language to define specification for HTTP based APIs Based on YAML Used to create a mutual contract between API Consumer and API provider which defines Resource(s) Request Response Security
  • 10. 10 Query Params and URI Params Query Params URI Params Used to sort/ filter on a given set of resource (records) Used to access a specific resource (record) Example: Find employees whose designation are workers. Example: Find distinct employee from employee database, using employeeId. https://www.abcbak.com/employees?designation=worker https://www.abcbank.com/employees?key=value Accessed using question mark ? and ampersand & https://www.abcbak.com/employees/12345 https://www.abcbank.com/employees/{employeeId} Accessed using curly braces {}
  • 11. 11 HTTP Methods and Response Codes HTTP Methods Description Example Response Code GET Fetch resources (records) from a given set of resource Fetch employees from employee database 200 POST Create a new resource (record) in a given set of resource Insert a new employee in employee database 201 PUT Create or Update an existing/ new resource Updating an employee details 200/ 201 PATCH Update an existing resource (record) Updating an employee salary 200 DELETE Delete an existing resource (record) Deleting an employee 200 HTTP Response Status Codes Informational responses 1xx 100-199 Successful responses 2xx 200-299 Redirection messages 3xx 300-399 Client error responses 4xx 400-499 Server error responses 5xx 500-599 HTTP Error Response Status Codes 401 Unauthorized 404 Not Found 500 Internal Server Error 502 Bad Gateway 503 Service Unavailable
  • 13. 13 Design Center Navigation ● Sign up for a 30 days free trial Anypoint Platform account https://anypoint.mulesoft.com/login/signup or just follow https://docs.mulesoft.com/access- management/managing-your-account ● Login to your account and click on three dashes on extreme up left on home page to show options. 1 2
  • 14. 14 Examples Examples are dummy responses across your API HTTP methods. For example: Success response, error response etc. RAML Based JSON Based Usage
  • 15. 15 Data Types ● Data types are used for describing data for its validation against type declaration. ● Example: ○ employeeId should be of integer type ○ employeeName should be of string type
  • 16. 16 Traits Traits are reusable components to help define common attributes for HTTP methods such as cacheable, filterable, searchable, pageable etc. Apart from serving above purpose, A trait can be designed for almost each and every feature such as a response, queryParams, headers etc. Define Include Use
  • 17. 17 Security Schemes It is a mechanism to secure data access, identify requests, and determine access level and data visibility at resource, method or even root RAML file level Type Description OAuth 1.0 The API authentication requires using OAuth 1.0 as described in RFC5849 OAuth 2.0 The API authentication requires using OAuth 2.0 as described in RFC6749 Basic Authentication The API authentication relies on using Basic Access Authentication as described in RFC2617 Digest Authentication The API authentication relies on using Digest Access Authentication as described in RFC2617 Pass Through Headers or query parameters are passed through to the API based on a defined mapping. x-{other} The API authentication relies on another authentication method.
  • 18. 18 Resource Types Resource types help to reduce/ eliminate frequent repetitive declarations of resources, methods etc. by using dynamic placeholders. ● Used to define reusable patterns for ○ Resources ○ Methods ● Advantages ○ Consistency ○ Reduces complexity ○ Less code
  • 19. 19 Library ● RAML libraries are used to combine any collection of ○ Data type ○ Resource type ○ Trait ○ Security scheme into modular, externalized, reusable groups. It can be defined as an external library and can be included in wherever required.
  • 20. 20 Fragments Reusable RAML documents/ snippets that can be used across API Specs as dependencies from Anypoint Exchange or external file/ folder. A fragment is an independent component that can be created and published on Anypoint Exchange. • Trait • Resource Type • Library • Type • User Documentation • Example • Annotation Type • Security Scheme
  • 21. Q&A
  • 23. 23 Question 1 RAML Stands for A. RESTful API Modeling Language B. Reserved API Modeling Language C. Routing API Modeling Language D. ReactJS API Modeling Language
  • 24. 24 Question 2 Which parameter is most suitable and standard way to access a specific/ distinct resource (record) from a collections of resources. A. Query Parameter (?key=value) B. URI Parameter (/{})
  • 25. 25 Question 3 Which of below is correct option to use example(s) from examples folder in a root RAML file A. #import examples/employeeExamples.raml B. #include examples/employeeExamples.raml C. !include examples/employeeExamples.raml D. @use examples/employeeExamples.raml
  • 26. 26 Question 4 A Fragment can be published/ deployed to Anypoint Exchange independently without being included in Any API Specification. A. True B. False
  • 27. 27 Bonus question Did you enjoy today’s session? Drop a feedback once you receive an official email after this meetup. Also, Send us a note on LinkedIn.