Create your first API proxy

What you'll learn

In this tutorial, you'll learn to:

  • Create an API proxy.
  • Configure the API proxy to send requests to an existing RESTful target server.
  • Call the API proxy using cURL.

This tutorial walks you through the process of creating and configuring a simple API proxy using the Apigee Edge management UI. (To understand why API proxies are so useful in the first place, see the Video concepts).

The API proxy you'll create is a "hello world". When you call the API proxy with an HTTP client (we'll use the cURL tool in a terminal window), the API proxy will send the request to an existing target service that returns text in the response.

What you'll need

  • An Apigee Edge account. If you don't have one yet, you can sign up with the directions at Creating an Apigee Edge account.
  • cURL installed on your machine to make API calls from the command line; or a web browser.

Create the API proxy

About the 'mocktarget'

The mocktarget service is hosted at Apigee and returns simple data. It requires no API key or access token. In fact, you can access it in a web browser. Try it out by clicking the following:

http://mocktarget.apigee.net

In the browser and in the test API call you'll make later, the target returns Hello, Guest!. Use the /help resource to get a help page of other API resources that are available.

  1. Go to https://apigee.com/edge and log in. This is the New Edge experience UI. (You could also use the classic management UI, which has slightly different navigation. Both UIs create the proxy in your organization.)
  2. Change to the organization you want. In the upper left, click your username, then click the name of the current organization to select from a list of organizations.
  3. Click API Proxies in the main window. This gives you a list of existing API proxies.

    Note: In the list of API proxies, you may already have one named helloworld. You can either delete this proxy and continue with the tutorial, or give the proxy in this tutorial a different name.

  4. Click the add (+) API Proxy button.
  5. In the Build a Proxy wizard, select Reverse proxy (most common), and click Next.
  6. Configure the proxy with the following:
    In this field do this
    Proxy Name

    Enter: helloworld

    If a proxy already exists with this name, just enter a different name, such as helloworld_tutorial.

    Proxy Base Path

    Change to: /hello

    The Proxy Base Path is part of the URL used to make requests to your API. Apigee Edge uses the URL to match and route incoming requests to the proper API proxy.

    Note: For Apigee's recommendations on API versioning, see Versioning in the Web API Design: The Missing Link e-book.

    Existing API

    Enter: http://mocktarget.apigee.net

    Be sure to use http and not https. This defines the target URL that Apigee Edge invokes on a request to the API proxy.

    Description Enter: hello world proxy

  7. Click Next.
  8. On the Security page, select Pass through (none) as the security option, and click Next.
  9. On the Virtual Hosts page, click Next.
  10. On the Build page, make sure the test environment is selected, and click Build and Deploy.
  11. On the Summary page, you see an acknowledgement that your new API proxy was created successfully and deployed to your test environment.
  12. Click View helloworld proxy in the editor to display the Overview page for the API proxy.

Congratulations! You've created a simple API proxy. Next you'll test it to see how it works.

Test the API proxy

You can test your helloworld API using cURL or a web browser.

In a terminal window, run the following cURL command. Substitute your organization name in the URL.

curl http://<org_name>-test.apigee.net/hello

Response

You should see the following:

Hello, Guest!

If you get a timeout error or your test is unsuccessful, try undeploying and then redeploying the new API proxy in the test environment. For more information, see Deploying and undeploying an API proxy. If you continue to experience this issue, contact Apigee Support.

Way to go! You've built a simple API proxy and tested it.

Was this page helpful? Let us know how we did:

Send feedback about...

Apigee Docs