Docs
uapigateway
Operation Guide
Open API
Create API

API Management

A complete API definition consists of “Basic Information”, “API Request Definition”, “API Backend Definition” and “API Response Definition”. The API has attributes of Region and Project. Once defined, they cannot be changed.

  • Basic information includes API group, API name, and API description. The API can only belong to the same Region, same Project API group, and cannot be changed once defined.
  • API request definition currently supports three protocols: HTTP / HTTPS / HTTP(S). The system uses protocol + domain + path + HTTPMethod defined by the API as a unique URI, which needs to be unique.
  • At present, the backend request only supports VPC type of request, it can be selected only after creating VPC authorization.

Create an API

  • The basic information of the API includes the group to which the API belongs, the API minute process, and the API description. The API definition names in the same Region and the same Project cannot be the same.

  • API request definition includes supported protocols, request Path, matching pattern, HTTP Method, and input parameter definition.

    • Request protocol: Request protocol supports three types: http / https / http(s).
    • Matching pattern: The matching pattern refers to the matching method of the request Path. If your url is /userInfo, and the matching pattern is an absolute match, then the request Path must be consistent with the definition. If the matching pattern is prefix matching, then it can
    • Input parameter definition: Input parameter definition comes in two types: parameter passthrough and parameter mapping. In the case of parameter passthrough, all the parameters in the client’s query / body / header will be passed to the backend. You can also add RestfulAPI recommended Path Parameter in the request Path. When using PathParameter, you must use input parameter mapping, and you need to define the parameters in the Path, select Path, mandatory. For example, if the defined request Path is /userInfo/[userId], you can put the userId parameter in the parameter list. The matching request path is /userInfo , /userInfo/ , /userInfo/get.
  • In the API backend request, you need to set the backend service and backend request Path.

    • Backend service, can get VPC authorization information from the VPC channel, or manually enter the VPC authorization ID. Manual input is generally used in the case of environment variable definition, suitable for the situation where the same program needs to run on different hosts.

    • Backend request Path can put environment variables and backend request parameters, backend request parameters are only used for parameter mapping.

  • In API return definition, you can set ContentType, success and failure return examples, and define error codes. ContentType will be added to the HTTP Response Header according to the setting.