This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Working with APIs via Tooling
You can create a new API or import an existing API from the file system using WSO2 EI tooling. You can also add an API resource to an existing API via WSO2 EI tooling.
You need to have WSO2 EI tooling installed to create a new API or to import an existing APIÂ via WSO2 EI tooling. For instructions on installing WSO2 EI tooling, see Installing Enterprise Integrator Tooling.
Creating a new API
Follow these steps to create a new API.Â
- In Eclipse, click the Developer Studio menu and then click Open Dashboard. This opens the Developer Studio Dashboard.
- Click REST API on the Developer Studio Dashboard.
- Leave the first option selected and click Next.
- Type a unique name for the new API and specify the context, hostname, and port. For more information, see Configuring Endpoints using REST APIs.
- Do one of the following:
- To save the API in an existing ESB Config project in your workspace, click Browse and select that project.
- To save the API in a new ESB Config project, click Create new ESB Project and create the new project.
- Click Finish. The REST API is created in theÂ
src/main/synapse-config/api
 folder under the ESB Config project you specified. When prompted, you can open the file in the editor, or you can right-click the API in the project explorer and click Open With > ESB Editor. Click its icon in the editor to view its properties.
Importing an API
Follow these steps to import an existing API into an ESB Config project.Â
- In Eclipse, click the Developer Studio menu and then click Open Dashboard. This opens the Developer Studio Dashboard.
- Click REST API on the Developer Studio Dashboard.
- Select Import API Artifact and click Next.
- Specify the XML file that defines the API by typing its full pathname or clicking Browse and navigating to the file.
- In the Save API In field, specify an existing ESB Config project in your workspace where you want to save the API, or click Create new ESB Project to create a new ESB Config project and save the API configuration there.
- If there are multiple API definitions in the file, click Create ESB Artifacts, and then select the artifacts you want to import.
- Click Finish. The APIs you selected are created in the subfolders of theÂ
src/main/synapse-config/api
 folder under the ESB Config project you specified, and the first API appears in the editor.
Adding an API resource
Follow these steps below to add an API resource to an existing API.
- Open an existing API in the editor.
- In the tool palette, click APIResource in the API section and simply drag and drop the resource to the REST API.
- You can now add mediators, endpoints etc to the resource and save.