Skip to main content

Version: 3.8.x

Launch Your First API

This tutorial describes launching and validating a simple API on API7 Enterprise. You will complete the following steps:

  1. Create a Published Service with a Route and an Upstream that points to httpbin upstream.
  2. Validate the created API by sending a request.

Prerequisites

  1. Install API7 Enterprise.
  2. Deploy a gateway instance based on your environment:
    1. To deploy API7 Gateways on Kubernetes and use an ingress controller, complete Deploy Gateway and Ingress Controller on Kubernetes.
    2. To deploy API7 Gateways in Docker, follow the Docker instruction in Add a Gateway Instance.

Create Service and Route

Create a Service

  1. Select Published Services under your gateway group from the side navigation bar and then click Add Service.
  2. Select Add Manually.
  3. From the Add Service dialog box, do the following:
    • In the Name field, enter httpbin.
    • In the Service Type field, choose HTTP (Layer 7 Proxy).
    • In the Upstream Scheme field, choose HTTP.
    • In the How to find the upstream field, choose Use Nodes.
    • Click Add Node.
    • From the Add Node dialog box, do the following:
      • In the Host field, enter httpbin.org.
      • In the Port field, enter 80.
      • In the Weight field, enter 100.
  4. Click Add. This will create a new service in the 'No Version' state.

Create a Route

  1. Click the service that you just created in the previous step, and then click Add Route.
  2. From the Add Route dialog box, do the following:
    • In the Name field, enter get-ip.
    • In the Path field, enter /ip.
    • In the Methods field, choose GET.
    • Click Add.

Below is an interactive demo that provides a hands-on introduction to creating no-version services. You will better understand how to use it in API7 Enterprise by clicking and following the steps.

Validate the API

In the dashboard, you should see a new service created under the Published Services.

Send a request to the route:

curl "http://127.0.0.1:9080/ip"

You should see the following response:

{
"origin": "127.0.0.1"
}

And that’s it. You have your first API running now.

Add APIs by Importing OpenAPI

You can also add APIs by importing OpenAPI 3.0 specification. To create a Service:

  1. Select Published Services under your gateway group from the side navigation bar and then click Add Service.
  2. Select Import OpenAPI.
  3. From the Add Service dialog box, do the following:
    • In the OpenAPI 3.0 Specification field, upload the httpbin.yaml file.
    • In the Upstream Scheme and Service Type fields, keep the default settings HTTP.
    • In the How to find the upstream field, keep the default setting Use Nodes.
    • Click Add Node.
    • From the Add Node dialog box, do the following:
      • In the Host field, enter httpbin.org.
      • In the Port field, enter 80.
      • In the Weight field, enter 100.
    • Click Next.
  4. Click Add. This will create a new service in the 'No Version' state. The basic information and labels are imported, and all paths in the openapi file are transformed to routes in the service.

Below is an interactive demo that provides a hands-on introduction to adding services by importing OpenAPI. You will better understand how to use it in API7 Enterprise by clicking and following the steps.

Additional Resources

API7.ai Logo

The digital world is connected by APIs,
API7.ai exists to make APIs more efficient, reliable, and secure.

Sign up for API7 newsletter

Product

API7 Gateway

SOC2 Type IIISO 27001HIPAAGDPRRed Herring

Copyright © APISEVEN PTE. LTD 2019 – 2025. Apache, Apache APISIX, APISIX, and associated open source project names are trademarks of the Apache Software Foundation