DZone
Integration Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Integration Zone > Create a RESTful Interface for an App From RAML in Anypoint

Create a RESTful Interface for an App From RAML in Anypoint

You can generate an entire interface from one simple API definition.

nikhil bangar user avatar by
nikhil bangar
·
Jan. 21, 17 · Integration Zone · Tutorial
Like (4)
Save
Tweet
6.56K Views

Join the DZone community and get the full member experience.

Join For Free

A RESTful interface for an application will have the listener for each of the methods defined by the API to interact with it.

GET:cust\ 

GET:cust\{ID} 

POST:cust\ 

We can generate that interface from the API definition. Let's get started. 

1. Download and install the APIKit plugin in Anypoint Studio.

Image title

Image title

2. You should have an account on Anypoint Platform to have an access to RAML API definition.

3. Write any RAML definition in API Designer based on the requirements that I have written to Customer for the kickstart.                   

Image title

4. Create a Mule project from the RAML definition.

Image title

5. You can create a project from a RAML definition, which is either on your local system or on the Anypoint Platform. We are going with Anypoint Platform.

Image title

6. After clicking Next, you will get all of the RAML definitions written in you Anypoint platform. Notice that the following image depicts only a single RAML Definition.

Image title

7. Select the appropriate RAML Definition and hit OK.

8. Check the project explorer, which includes the RAML definition from Anypoint Platform.

Image title

9. Check the customer-api.xml canvas. It should show the main flow, the flow for each resource methods, and the flow for exception handling.

Image title

The main flow.

Image title

Flow for each resources methods.

Image title

The exception handling flow.

10. Check src/main/api in the project explorer or API async for RAML definition.

Image title

Image title

11. Running the RAML-Demo project, you can see the output either on the APIKit Console or on POSTMAN.

Image title

APIKit console.

Image title

POSTMAN.

Interface (computing) REST Web Protocols app

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Why You Should Stop Relying on Jenkins Plug-ins
  • Instancio: Test Data Generator for Java (Part 2)
  • What Is Pair Programming?
  • Building a QR Code Generator with Azure Functions

Comments

Integration Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo