SlideShare a Scribd company logo
1 of 28
Download to read offline
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

What's hot

Interface callable statement
Interface callable statementInterface callable statement
Interface callable statement
myrajendra
 

What's hot (18)

Mule anypoint data gateway
Mule  anypoint data gatewayMule  anypoint data gateway
Mule anypoint data gateway
 
Jdbc
JdbcJdbc
Jdbc
 
Spring integration with the Java DSL
Spring integration with the Java DSLSpring integration with the Java DSL
Spring integration with the Java DSL
 
Database and Java Database Connectivity
Database and Java Database ConnectivityDatabase and Java Database Connectivity
Database and Java Database Connectivity
 
Jdbc Ppt
Jdbc PptJdbc Ppt
Jdbc Ppt
 
Linq in asp.net
Linq in asp.netLinq in asp.net
Linq in asp.net
 
jdbc document
jdbc documentjdbc document
jdbc document
 
JDBC
JDBCJDBC
JDBC
 
Jdbc
JdbcJdbc
Jdbc
 
Jdbc
JdbcJdbc
Jdbc
 
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivity
 
Java- JDBC- Mazenet Solution
Java- JDBC- Mazenet SolutionJava- JDBC- Mazenet Solution
Java- JDBC- Mazenet Solution
 
Jdbc_ravi_2016
Jdbc_ravi_2016Jdbc_ravi_2016
Jdbc_ravi_2016
 
Interface callable statement
Interface callable statementInterface callable statement
Interface callable statement
 
Basic Java Database Connectivity(JDBC)
Basic Java Database Connectivity(JDBC)Basic Java Database Connectivity(JDBC)
Basic Java Database Connectivity(JDBC)
 
Overview Of JDBC
Overview Of JDBCOverview Of JDBC
Overview Of JDBC
 
Jdbc architecture and driver types ppt
Jdbc architecture and driver types pptJdbc architecture and driver types ppt
Jdbc architecture and driver types ppt
 
java Jdbc
java Jdbc java Jdbc
java Jdbc
 

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

Web REST APIs Design Principles
Web REST APIs Design PrinciplesWeb REST APIs Design Principles
Web REST APIs Design Principles
Anji Beeravalli
 
01_Team_03_CS_591_Project
01_Team_03_CS_591_Project01_Team_03_CS_591_Project
01_Team_03_CS_591_Project
harsh mehta
 

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

Mule soft meetup_4_mty_online_oct_2020
Mule soft meetup_4_mty_online_oct_2020Mule soft meetup_4_mty_online_oct_2020
Mule soft meetup_4_mty_online_oct_2020
 
Anypoint DataGraph - Consume & Re-use your APIs faster | MuleSoft Mysore Meet...
Anypoint DataGraph - Consume & Re-use your APIs faster | MuleSoft Mysore Meet...Anypoint DataGraph - Consume & Re-use your APIs faster | MuleSoft Mysore Meet...
Anypoint DataGraph - Consume & Re-use your APIs faster | MuleSoft Mysore Meet...
 
A Deep Dive into RESTful API Design Part 2
A Deep Dive into RESTful API Design Part 2A Deep Dive into RESTful API Design Part 2
A Deep Dive into RESTful API Design Part 2
 
Mule soft meetup__official__feb-27_2021
Mule soft meetup__official__feb-27_2021Mule soft meetup__official__feb-27_2021
Mule soft meetup__official__feb-27_2021
 
API Specifications and Best Practices | MuleSoft Mysore Meetup #4
API Specifications and Best Practices | MuleSoft Mysore Meetup #4API Specifications and Best Practices | MuleSoft Mysore Meetup #4
API Specifications and Best Practices | MuleSoft Mysore Meetup #4
 
MuleSoft Surat Virtual Meetup#9 - RAML Reusability and Simplified
MuleSoft Surat Virtual Meetup#9 - RAML Reusability and SimplifiedMuleSoft Surat Virtual Meetup#9 - RAML Reusability and Simplified
MuleSoft Surat Virtual Meetup#9 - RAML Reusability and Simplified
 
MuleSoft Surat Meetup#39 - Pragmatic API Led Connectivity
MuleSoft Surat Meetup#39 - Pragmatic API Led ConnectivityMuleSoft Surat Meetup#39 - Pragmatic API Led Connectivity
MuleSoft Surat Meetup#39 - Pragmatic API Led Connectivity
 
Web REST APIs Design Principles
Web REST APIs Design PrinciplesWeb REST APIs Design Principles
Web REST APIs Design Principles
 
01_Team_03_CS_591_Project
01_Team_03_CS_591_Project01_Team_03_CS_591_Project
01_Team_03_CS_591_Project
 
Content Strategy and Developer Engagement for DevPortals
Content Strategy and Developer Engagement for DevPortalsContent Strategy and Developer Engagement for DevPortals
Content Strategy and Developer Engagement for DevPortals
 
Faridabad MuleSoft Meetup Group (1).pdf
Faridabad MuleSoft Meetup Group (1).pdfFaridabad MuleSoft Meetup Group (1).pdf
Faridabad MuleSoft Meetup Group (1).pdf
 
mulesoft birmingham meetup_api_designing_with_raml
mulesoft birmingham meetup_api_designing_with_ramlmulesoft birmingham meetup_api_designing_with_raml
mulesoft birmingham meetup_api_designing_with_raml
 
A RESTful introduction
A RESTful introductionA RESTful introduction
A RESTful introduction
 
YM API Xperience 2016
YM API Xperience 2016YM API Xperience 2016
YM API Xperience 2016
 
The ins and outs of RAML
The ins and outs of RAMLThe ins and outs of RAML
The ins and outs of RAML
 
Deep Dive into REST API Development | MuleSoft Mysore Meetup #16
Deep Dive into REST API Development | MuleSoft Mysore Meetup #16Deep Dive into REST API Development | MuleSoft Mysore Meetup #16
Deep Dive into REST API Development | MuleSoft Mysore Meetup #16
 
API_Design_Rest_Princple.pdf
API_Design_Rest_Princple.pdfAPI_Design_Rest_Princple.pdf
API_Design_Rest_Princple.pdf
 
Mumbai MuleSoft Meetup #15
Mumbai MuleSoft Meetup #15Mumbai MuleSoft Meetup #15
Mumbai MuleSoft Meetup #15
 
Log4j2 - A deep dive into the logging services in Mulesoft with On-Prem deplo...
Log4j2 - A deep dive into the logging services in Mulesoft with On-Prem deplo...Log4j2 - A deep dive into the logging services in Mulesoft with On-Prem deplo...
Log4j2 - A deep dive into the logging services in Mulesoft with On-Prem deplo...
 
Generative AI Masterclass - Model Risk Management.pptx
Generative AI Masterclass - Model Risk Management.pptxGenerative AI Masterclass - Model Risk Management.pptx
Generative AI Masterclass - Model Risk Management.pptx
 

More from Jitendra Bafna

More from Jitendra Bafna (20)

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

Recently uploaded

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational Performance
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governance
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

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.