Skip to main content

Create a REST API from scratch

In the API Control Plane, you can expose an existing HTTP backend through a gateway by creating a REST API proxy. When you start from scratch, you provide a backend 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 backend, deploying it to a gateway, testing it, and publishing it to a portal.

Prerequisites​

Before you begin, make sure you have access to the console.

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

Create the REST API​

  1. On the project home page, click Create API.

  2. Select REST API, then choose Start from scratch.

    Start from scratch creates a blank API with one wildcard path, /*, for the GET, POST, PATCH, and DELETE methods. You can change these resources after you create the API.

  3. Under Backend endpoint, enter your backend URL in the Endpoint URL field. To use the sample Reading List API backend, click Try with Sample URL. Endpoint URL is required.

    The sample URL is:

    https://apis.bijira.dev/samples/reading-list-api-service/v1.0/books
  4. Click Continue.

  5. On the Configure and create page, review the Basic information and Backend endpoint sections. The console automatically populates fields such as Identifier and Context. Review the generated values and update them if needed.

    The following table shows example values for the Reading List API.

    FieldExample value
    NameReading List API
    Identifierreading-list-api
    Version1.0.0
    Context/default/reading-list-api/v1.0.0
    DescriptionOptional. The console leaves it empty.
    Endpointhttps://apis.bijira.dev/samples/reading-list-api-service/v1.0/books
  6. Click Create.

The console adds the REST API to your project, with the wildcard resources.

To add your own resources, such as GET /books/{id}, or to remove the wildcard resources, 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?