10
DESIGN A RAML-BASED REST API WITH MULESOFT ANYPOINT API MANAGER

RAML Based API With MuleSoft Anypoint API Manager

Embed Size (px)

Citation preview

Page 1: RAML Based API With MuleSoft Anypoint API Manager

DESIGN A RAML-BASED REST API WITH MULESOFT

ANYPOINT API MANAGER

Page 2: RAML Based API With MuleSoft Anypoint API Manager

RAML (REST API MODELING LANGUAGE)

RAML (Rest API Modeling Language) is based on YAML format, which is used to design REST APIs. RAML provides

various features, including standardization, reusability, easy readability, and much more.

RESTful API Modeling Language (RAML) makes it easy to manage the whole API lifecycle from design

to sharing. It's concise - you only write what you need to define - and reusable. It is machine readable

API design that is actually human friendly.

Page 3: RAML Based API With MuleSoft Anypoint API Manager

STEPS TO CREATE API USING ANYPOINT API MANAGER

Create an Anypoint MuleSoft Account

Create an Anypoint MuleSoft account and sign into the Anypoint MuleSoft platform.

Add a New API

First, go to API Manager as shown below:

Page 4: RAML Based API With MuleSoft Anypoint API Manager

STEPS TO CREATE API USING ANYPOINT API MANAGER

Click API Manager to reach the API Manager Screen. Then, click Add New API. Fill in the details like API name and Version

name. Description and API endpoint are optional.

After filling in these details, click Add.

Page 5: RAML Based API With MuleSoft Anypoint API Manager

STEPS TO CREATE API USING ANYPOINT API MANAGER

We will be navigated to API Manager Designer, where we can start writing the RAML.We can see the documentation on the

left side, depending on the RAML we are writing.

On the right side, we can see the RAML file name. By default, the file name will be api.raml. We can rename the RAML filename

by right clicking on api.raml. The extension of a RAML file is always .raml.

Page 6: RAML Based API With MuleSoft Anypoint API Manager

STEPS TO CREATE API USING ANYPOINT API MANAGER

We can see title and version have already been defined by default at the root level. Title and Version will be the same, as we

mentioned in Step 2. Now, we can start defining the RAML.

Page 7: RAML Based API With MuleSoft Anypoint API Manager

STEPS TO CREATE API USING ANYPOINT API MANAGER

We can see title and version have already been defined by default at the root level. Title and Version will be the same, as we

mentioned in Step 2. Now, we can start defining the RAML.

Page 8: RAML Based API With MuleSoft Anypoint API Manager

STEPS TO CREATE API USING ANYPOINT API MANAGER

As we are writing the RAML, we can see the documentation being generated on the left side of the screen.

Page 9: RAML Based API With MuleSoft Anypoint API Manager

TEST THE API FROM API MANAGER

We need to enable Mocking Service for testing the API. Once we will enable the mocking service, then baseURI will be added

to the RAML.

Page 10: RAML Based API With MuleSoft Anypoint API Manager

TEST THE API FROM API MANAGER

After enabling the mocking service, we can test the REST API by clicking on any of the HTTP methods on the left side of

the screen. Then, click Try it!.