Skip to main content

What is API

Estimated reading time: 0 min read

In API7 Cloud, an API is a specific endpoint exposed by an Application.

How to Create an API

Note API is a sub-attribute of the Application, so before you go further, please create an Application first.

HTTPBIN Application Details

On the Application details page, scroll down to the API section and click on the Create API button, and you'll be redirected to a form to create an API. Create HTTPBIN JSON API

Two kinds of content that you should fill out:

  1. Basic, fields like name, path, and method should be filled out.
info

The ultimate URI path of the API will start with the Path Prefix (defined in Application).

  1. Policies, where you can specify a set of policies.

Get API Details

On the Application details page, please scroll down to the API section, search for the API you want to see, and click on its name. API7 Cloud will redirect you to the API details page.

HTTPBIN JSON API DETAIL

Update API

There are two ways that you can edit an API.

On the Application details page, scroll down to the API section, search for the API you want to see, and click on the pencil icon. API7 Cloud will redirect you to the API update page.

Update API in API List

On the other hand, you can update an API after you enter the API details page, click on the pencil icon in the upper right, and similarly, you'll be redirected to the API update page.

Update API in API Details Page

Delete API

danger

IT'S DANGEROUS TO DELETE AN API, SO PLEASE MAKE SURE YOU NO LONGER USE THIS API.

Delete JSON API

On the Application details page, scroll down to the API section, search for the API you want to delete, and click on the trash can icon. API7 Cloud will prompt you to confirm the deletion.

Double Check of Delete JSON API

Key Fields

Some fields are vital for the API to work.

Path

Path is the URI path of the API. It'll start with the Path Prefix. You can decide to if strip the Path Prefix (through the Strip Application Path Prefix option) before the request goes upstream. As an example, if the Path Prefix is /api/v1, the Path is /products, requests will have /api/v1/products as the URI path when they go to the upstream if the Strip Application Path Prefix option is disabled; On the contrary, if the Strip Application Path Prefix is enabled, the Path will be /products, and requests will have /products.

note

API7 Cloud inserts a slash (/) between the Path Prefix and the Path, so if the Path Prefix is /api/v1, and Path is products, the URI path will be /api/v1/products instead of /api/v1products.

The match type for the Path can be exact or prefix. An exact match means the URI path of requests should be identical to the API Path. Prefix match means the URI path of requests should start with the Path of this API. As an example, if the Path is /products, and the match type is prefix, then /products/c2fb7846, /products123 will be matched. But if the match type is exact, then only /products can be matched.

Method

Method limits the allowed HTTP methods. It's an optional field. By default, API7 Cloud doesn't limit the HTTP methods.

What's Next