APIkit Overview

APIkit and APIkit for SOAP are toolkits for REST or SOAP API development. APIkit converts standard web service specification documents into skeletal flows in the Mule project. The generated, minimal flows meet the communication operations required by the web service contract. Included are flows for handling error conditions, setting status codes, and making RESTful calls or SOAP API requests.

You develop APIs based on one of the following modeling languages:

  • RESTful API Modeling Language

  • Web Service Description Language

You can reference an external RAML or WSDL design, import the design into Studio, or build the RAML or WSDL within Studio using the text editor.

You can use API Console to simulate calls to a RAML-based API.

APIkit supports RAML 1.0 and 0.8 versions. APIkit projects can run onsite or on CloudHub. You can create APIkit flows for Mule in XML. Using Studio automates the process. There are several ways to get started using APIkit in Studio:

  • From the Studio Project Wizard import a RAML or WSDL definition from one of the following sources:

    • Local file system

    • Anypoint Platform

    • A remote location

  • Create the RAML file within an existing Studio project (called a backend-first APIkit design).

The best practice for API design with APIkit is first to design the RAML or WSDL interface outside Studio. For RAML development, MuleSoft recommends using Design Center. Next, you import the file into a Studio project to construct your main and backend flows. Alternatively, you can design the backend first by adding an API to an existing Studio project.

After adding the RAML content, you can use API Console to simulate the API. After testing, you build out the flows to implement the API: add web services, document, and so on.

About RAML-based APIkit Flows

If you create a new RAML-based Studio project and do not specify a RAML file, but you check the Add API Components checkbox, APIkit generates a skeletal RAML file and XML config that includes the following things:

  • HTTP Listener configuration

    After importation, you can replace the HTTP Listener with a Jetty endpoint.

  • APIkit Router component

  • Exception strategies flows

If you create a new Studio project and do specify a RAML file, APIkit includes any RAML dependencies in the Studio project. You can then keep the API in both locations in sync by pushing or pulling changes from one to the other.

Included in the project are backend flows containing REST resource-action mappings. You can simulate calls to the API using API Console when you import a RAML.

If you change or add exception strategies, you need to adjust references to exception strategies. If you rename a backend flow, you have to map resources to actions as shown in "Workflow: Add APIkit Components to an Existing Project."

About WSDL-based APIkit Flows

If you create a new WSDL-based Studio project that a namespace and you specify a namespace, APIkit generates the following things:

  • A main flow with an HTTP Listener

  • An SOAP Router

  • A SOAP fault response template

Included in the project are backend flows containing SOAP message templates. You need to use a SOAP testing tool, such as SoapUI, to simulate calls to the API. If you change the WSDL, regenerate backend flows using Mule > Generate SOAP Flows.