Skip to main content

Start with a contract

In the API Control Plane, you can expose an existing HTTP backend through a gateway by creating a REST API proxy. When you start with a contract, you provide a contract URL, and the console generates the initial API details for you. You can then review the API definition, customize its operations, and deploy it to a gateway.

This walks you through creating a REST API using a sample contract, deploying it to a gateway, testing it, and publishing it to a portal.

Prerequisites​

  1. Open the API Control Plane and sign in using Google or GitHub.
  2. Open your organization, then select the Default Project or create a new project.

Create the API​

  1. On the project home page, click Create API.
  2. Select REST API, then choose Start with a contract.
  3. Import the contract from a URL or from a file, as described in the next two sections.

Import the contract from a URL​

  1. Select URL.

  2. Enter the contract URL in the URL for API Contract field. To use the sample Reading List API contract, click Try with Sample URL.

    https://raw.githubusercontent.com/wso2/bijira-samples/refs/heads/main/reading-list-api/openapi.yaml
  3. Wait for the contract to finish loading. The API resources list shows the imported operations. To see the contract itself, turn on Source.

  4. Click Continue, and go to Configure and create the API.

Upload a contract file​

  1. Select Upload.
  2. Drag the contract file into the upload area, or click the area to browse for the file. The supported file types are .json, .yaml, and .yml.
  3. Click Continue, and go to Configure and create the API.

Configure and create the API​

  1. On the Configure and create page, review the values that the console fills in from the contract. For the sample contract in the Default Project, the values are as follows:

    FieldExample value
    NameReading List API
    Identifierreading-list-api
    Version1.0
    Context/default/reading-list-api/v1.0
    DescriptionThis is a sample proxy that manages a list of reading items.
    Endpointhttps://apis.bijira.dev/samples/reading-list-api-service/v1.0
  2. Update the values if needed. Make sure Endpoint points to the backend service that the gateway calls.

  3. Click Create.

To view or change the imported operations, see Definition.

Deploy the API​

Deploying places a build of the API on a gateway so requests can reach the backend through that gateway.

  1. Choose a gateway. Your organization has a cloud gateway named Default, in the development environment. To deploy to another gateway, create it first. See Manage Gateways.
  2. Go to the Deploy section and deploy the API to the gateway. For more information, see Deploy an API.

Test the API​

After deploying the API, test its operations to verify that requests can be sent through the gateway.

  1. In the left navigation menu, click Test.
  2. Use the API Console or cURL to send a request through the gateway and inspect the response.

For more information, see API Console and cURL.

Publish the API​

Publishing makes the API available to developers through a portal, where they can discover the API and access its documentation.

  1. Create a portal first if the organization does not have one. See Manage Portals.
  2. Publish the API. See Publish an API.

Next Steps​

Was this page helpful?