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
Create the API proxy
- 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.)
- 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.
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.
- Click the add (+) API Proxy button.
- In the Build a Proxy wizard, select Reverse proxy (most common), and click Next.
- Configure the proxy with the following:
In this field do this Proxy Name
If a proxy already exists with this name, just enter a different name, such as
Proxy Base Path
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.
Be sure to use http and not https. This defines the target URL that Apigee Edge invokes on a request to the API proxy.
hello world proxy
- Click Next.
- On the Security page, select Pass through (none) as the security option, and click Next.
- On the Virtual Hosts page, click Next.
- On the Build page, make sure the test environment is selected, and click Build and Deploy.
- On the Summary page, you see an acknowledgement that your new API proxy was created
successfully and deployed to your test environment.
- 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.
You should see the following:
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.