Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

An API allows you to send a message directly into the ESB and perform specific logic on it based on the instructions in the HTTP call. This section introduces the fundamentals of creating APIs in the ESB. It illustrates the concepts through the XML configuration. For information on adding an API through the Management Console UI, see Adding APIs in the Management Console

Defining an API

The syntax of a REST API is as follows.

Code Block
languagexml
<api xmlns="http://ws.apache.org/ns/synapse" name="string" context="/string" hostname="string" port="integer">
   <resource/>
</api>

 

An API definition is identified by the <api> tag. Each API must specify a unique name and a unique URL context (see below). An API is made of one or more resources, which is a logical component of an API that can be accessed by making a particular type of HTTP call. For example:

...