SlideShare une entreprise Scribd logo
1  sur  15
Delight Driven Development of
REST APIs with RAML
By Vijay Dhanakodi
REST is also called as representational state transfer.
The REST API lets us to interact with anything that can send an
HTTP request.
REST APIs are very easy to create and design and it supports
various methods like GET, POST, PUT, DELETE etc to perform
various types of operations.
In Mule, we can create and design a REST service various ways.
But, with the new specification of RAML, it became quite a easy
task to create, design and test our APIs as per our requirement.
Before we start, we will actually look into what RAML really is.
RAML which is also called as RESTful API Modeling Language,
helps us to manage the whole api lifecycle starting from it’s design,
develop to sharing.
It is basically build on top of YAML for describing RESTful APIs and
provides all the information to describe an API.
Reference :- http://raml.org/
Advantage of RAML:-
RAML can be designed in API designer.
API Designer is a standalone/embeddable editor for RAML
(RESTful API Modeling Language) written in JavaScript using
Angular.JS. By default, the editor uses an in-browser filesystem
stored in HTML5 Local storage.
API designer :- https://www.mulesoft.com/platform/api/api-
designer
With this tool/editor, we can design our APIs and test it there itself
using a mock service with the tool.
So, we need to log in into our account to start designing our APIs.
https://anypoint.mulesoft.com/#/signin
If we don’t have an account we can sign up and create one.
Once we sign in, we need to click APIs menu in the top right as follows:-
If we don’t have any API present there in our account, we can create a
new API by clicking the button as below :-
Now, a dialog box will arrive and we will be filling it by giving our API
name, Version name and a end point as follows :-
So, we will be creating our first RAML in the API designer as follows.:-
Now, we will add some more tags in the file like Protocols and Media Type
Resource :- Resources are identified by their relative URI, which MUST begin
with a slash (/).
Now we can add methods for our resources.
methods :- methods are operations that are performed on a resource.
There can be several methods applied on a resources such as :-
* GET
* POST
* PUT
* DELETE
and many more.
We will be seeing GET performed on our resource.
Methods also contains the properties like displayName and description
As you can see here, we applied GET method on our resource /product
We can add our custom headers in our API

Contenu connexe

Tendances

Tendances (20)

Apimanagement
ApimanagementApimanagement
Apimanagement
 
LINE developers site the tech behind the docs
LINE developers site the tech behind the docsLINE developers site the tech behind the docs
LINE developers site the tech behind the docs
 
Schema-First API Design
Schema-First API DesignSchema-First API Design
Schema-First API Design
 
API Façade Pattern
API Façade PatternAPI Façade Pattern
API Façade Pattern
 
Quality sdk for your apis in minutes!
Quality sdk for your apis in minutes!Quality sdk for your apis in minutes!
Quality sdk for your apis in minutes!
 
Creating a custom connector in mule
Creating a custom connector in muleCreating a custom connector in mule
Creating a custom connector in mule
 
Mule Integration with Dropbox
Mule Integration with DropboxMule Integration with Dropbox
Mule Integration with Dropbox
 
Manage and consume the api
Manage and consume the apiManage and consume the api
Manage and consume the api
 
Mule ESB integration with Stripe
Mule ESB integration with StripeMule ESB integration with Stripe
Mule ESB integration with Stripe
 
Salesforce Integration using Mule ESB
Salesforce Integration using Mule ESBSalesforce Integration using Mule ESB
Salesforce Integration using Mule ESB
 
Integration with Microsoft SharePoint using Mule ESB
Integration with Microsoft SharePoint using Mule ESBIntegration with Microsoft SharePoint using Mule ESB
Integration with Microsoft SharePoint using Mule ESB
 
App Manifest
App ManifestApp Manifest
App Manifest
 
Software components design for poc and mvp, keep it simple but be ready to sc...
Software components design for poc and mvp, keep it simple but be ready to sc...Software components design for poc and mvp, keep it simple but be ready to sc...
Software components design for poc and mvp, keep it simple but be ready to sc...
 
Creating a mule project with raml and api
Creating a mule project with raml and apiCreating a mule project with raml and api
Creating a mule project with raml and api
 
Mule with facebook
Mule with facebookMule with facebook
Mule with facebook
 
ActionBarCompat Tutorial-Part 1(Prepare and Setup)
ActionBarCompat Tutorial-Part 1(Prepare and Setup)ActionBarCompat Tutorial-Part 1(Prepare and Setup)
ActionBarCompat Tutorial-Part 1(Prepare and Setup)
 
The API Facade Pattern: Common Patterns - Episode 2
The API Facade Pattern: Common Patterns - Episode 2The API Facade Pattern: Common Patterns - Episode 2
The API Facade Pattern: Common Patterns - Episode 2
 
Mule esb stripe
Mule esb stripeMule esb stripe
Mule esb stripe
 
Varaprasad-Go
Varaprasad-GoVaraprasad-Go
Varaprasad-Go
 
Rails engine
Rails engineRails engine
Rails engine
 

Similaire à Rest With Raml

Similaire à Rest With Raml (20)

Raml part 1
Raml part 1Raml part 1
Raml part 1
 
Web API Design
Web API DesignWeb API Design
Web API Design
 
Web API Design: Crafting Interfaces that Developers Love
Web API Design:  Crafting Interfaces that Developers LoveWeb API Design:  Crafting Interfaces that Developers Love
Web API Design: Crafting Interfaces that Developers Love
 
What is Design Center | API Designer | API Specification
What is Design Center | API Designer | API SpecificationWhat is Design Center | API Designer | API Specification
What is Design Center | API Designer | API Specification
 
Building restful apis with laravel
Building restful apis with laravelBuilding restful apis with laravel
Building restful apis with laravel
 
Practical guide to building public APIs
Practical guide to building public APIsPractical guide to building public APIs
Practical guide to building public APIs
 
IBM Integration Bus and REST APIs - Sanjay Nagchowdhury
IBM Integration Bus and REST APIs - Sanjay NagchowdhuryIBM Integration Bus and REST APIs - Sanjay Nagchowdhury
IBM Integration Bus and REST APIs - Sanjay Nagchowdhury
 
Api Testing.pdf
Api Testing.pdfApi Testing.pdf
Api Testing.pdf
 
RAML - The architecture
RAML  - The architectureRAML  - The architecture
RAML - The architecture
 
Building APIs with Node.js and MonogDB
Building APIs with Node.js and MonogDBBuilding APIs with Node.js and MonogDB
Building APIs with Node.js and MonogDB
 
API.docx
API.docxAPI.docx
API.docx
 
A Practical Guide to Automating End-to-End API Testing
A Practical Guide to Automating End-to-End API TestingA Practical Guide to Automating End-to-End API Testing
A Practical Guide to Automating End-to-End API Testing
 
Understanding API Architectures: Web API vs. Minimal API – An In-Depth Compar...
Understanding API Architectures: Web API vs. Minimal API – An In-Depth Compar...Understanding API Architectures: Web API vs. Minimal API – An In-Depth Compar...
Understanding API Architectures: Web API vs. Minimal API – An In-Depth Compar...
 
Api design part 1
Api design part 1Api design part 1
Api design part 1
 
How to Develop APIs - Importance, Types, Tools, Terminology, and Best Practic...
How to Develop APIs - Importance, Types, Tools, Terminology, and Best Practic...How to Develop APIs - Importance, Types, Tools, Terminology, and Best Practic...
How to Develop APIs - Importance, Types, Tools, Terminology, and Best Practic...
 
Guide To API Development – Cost, Importance, Types, Tools, Terminology, and B...
Guide To API Development – Cost, Importance, Types, Tools, Terminology, and B...Guide To API Development – Cost, Importance, Types, Tools, Terminology, and B...
Guide To API Development – Cost, Importance, Types, Tools, Terminology, and B...
 
Mule api gateway overview
Mule api gateway overviewMule api gateway overview
Mule api gateway overview
 
REST full API Design
REST full API DesignREST full API Design
REST full API Design
 
Rest api best practices – comprehensive handbook
Rest api best practices – comprehensive handbookRest api best practices – comprehensive handbook
Rest api best practices – comprehensive handbook
 
Play Your API with MuleSoft API Notebook
Play Your API with MuleSoft API NotebookPlay Your API with MuleSoft API Notebook
Play Your API with MuleSoft API Notebook
 

Dernier

Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
Kamal Acharya
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 

Dernier (20)

Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptx
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 

Rest With Raml

  • 1. Delight Driven Development of REST APIs with RAML By Vijay Dhanakodi
  • 2. REST is also called as representational state transfer. The REST API lets us to interact with anything that can send an HTTP request. REST APIs are very easy to create and design and it supports various methods like GET, POST, PUT, DELETE etc to perform various types of operations. In Mule, we can create and design a REST service various ways. But, with the new specification of RAML, it became quite a easy task to create, design and test our APIs as per our requirement.
  • 3. Before we start, we will actually look into what RAML really is. RAML which is also called as RESTful API Modeling Language, helps us to manage the whole api lifecycle starting from it’s design, develop to sharing. It is basically build on top of YAML for describing RESTful APIs and provides all the information to describe an API. Reference :- http://raml.org/
  • 5. RAML can be designed in API designer. API Designer is a standalone/embeddable editor for RAML (RESTful API Modeling Language) written in JavaScript using Angular.JS. By default, the editor uses an in-browser filesystem stored in HTML5 Local storage. API designer :- https://www.mulesoft.com/platform/api/api- designer With this tool/editor, we can design our APIs and test it there itself using a mock service with the tool.
  • 6. So, we need to log in into our account to start designing our APIs. https://anypoint.mulesoft.com/#/signin If we don’t have an account we can sign up and create one.
  • 7. Once we sign in, we need to click APIs menu in the top right as follows:-
  • 8. If we don’t have any API present there in our account, we can create a new API by clicking the button as below :-
  • 9. Now, a dialog box will arrive and we will be filling it by giving our API name, Version name and a end point as follows :-
  • 10. So, we will be creating our first RAML in the API designer as follows.:-
  • 11. Now, we will add some more tags in the file like Protocols and Media Type
  • 12. Resource :- Resources are identified by their relative URI, which MUST begin with a slash (/).
  • 13. Now we can add methods for our resources. methods :- methods are operations that are performed on a resource. There can be several methods applied on a resources such as :- * GET * POST * PUT * DELETE and many more. We will be seeing GET performed on our resource. Methods also contains the properties like displayName and description
  • 14. As you can see here, we applied GET method on our resource /product
  • 15. We can add our custom headers in our API