Getting started overview

Apigee is a platform for developing and managing APIs, designed to facilitate full lifecycle API management for enterprise-scale operations developers.google.com/apigee. The initial setup involves configuring a Google Cloud project, provisioning an Apigee instance, and deploying an API proxy. This guide outlines the steps to get an Apigee environment operational and make a first API call.

The process generally follows these stages:

  1. Google Cloud project setup and Apigee API enablement.
  2. Provisioning an Apigee instance (Apigee X or Apigee Hybrid).
  3. Creating and deploying an API proxy.
  4. Generating API keys for client application access.
  5. Making a test call to the deployed API proxy.

This guide focuses on Apigee X, Google Cloud's managed Apigee offering, for its streamlined setup compared to Apigee Hybrid, which requires more extensive infrastructure configuration Apigee X prerequisites documentation.

Create an account and get keys

To begin, you need a Google Cloud account. If you do not have one, you can sign up for a Google Cloud free trial. Once your account is active, follow these steps:

1. Create a Google Cloud Project

All Apigee resources are associated with a Google Cloud project. Navigate to the Google Cloud Console project selector and create a new project. Give it a descriptive name, such as apigee-getting-started.

2. Enable the Apigee API

Within your newly created project, search for "Apigee API" in the Google Cloud Console search bar and enable it. Enabling the API grants your project the necessary permissions to provision Apigee resources Apigee API enablement guide.

3. Provision an Apigee Instance (Apigee X)

Provisioning an Apigee instance sets up the runtime environment where your API proxies will run. This is a multi-step process:

  1. Network Configuration: Apigee X requires a Virtual Private Cloud (VPC) network and a Service Networking connection. Navigate to VPC Network Peering and establish a private connection.
  2. Provisioning Wizard: In the Google Cloud Console, search for "Apigee" and select "Apigee X". Follow the provisioning wizard. You will need to specify a region, an Apigee organization name (which defaults to your project ID), and select the previously configured VPC network. This process can take up to an hour to complete Apigee X provisioning instructions.

4. Create an API Proxy

An API proxy is a facade for your backend services, through which Apigee applies policies like security, rate limiting, and analytics. For this guide, create a simple proxy that targets a publicly available endpoint.

  1. Navigate to Apigee UI: Once your Apigee instance is provisioned, go to the Apigee UI within the Google Cloud Console.
  2. Create Proxy: Click "Develop" > "API Proxies" > "+ Create Proxy".
  3. Select Proxy Type: Choose "Reverse proxy (most common)".
  4. Proxy Details:
    • Proxy Name: test-proxy
    • Base Path: /v1/test
    • Existing API: https://mocktarget.apigee.net (a public test endpoint)
  5. Security: Select "Pass through (no authorization)" for simplicity in this initial setup.
  6. Build and Deploy: Follow the remaining steps, selecting default options, and deploy the proxy to the test environment.

5. Generate API Keys

To secure access to your API proxy, Apigee uses API keys. You will create a product, a developer, and a developer app to obtain a key.

  1. Create an API Product:
    • Go to "Publish" > "API Products" > "+ Create API Product".
    • Name: TestProduct
    • Display Name: Test Product
    • API Proxies: Add test-proxy.
    • Save the product.
  2. Create a Developer:
    • Go to "Publish" > "Developers" > "+ Developer".
    • Provide an email (e.g., [email protected]) and first/last names.
    • Save the developer.
  3. Create a Developer App:
    • Go to "Publish" > "Developer Apps" > "+ Create App".
    • Name: TestApp
    • Developer: Select the developer created in the previous step.
    • Products: Add TestProduct.
    • Save the app.
  4. Retrieve API Key: Open the TestApp details. The consumer key listed is your API key. Copy this value.

Your first request

With an Apigee instance, a deployed proxy, and an API key, you can now make your first request. You will need your Apigee Gateway Hostname, which can be found in the Apigee UI under "Admin" > "Environments" > "Overview" for your test environment. It will look similar to your-org-name-eval.apigee.net.

Use a tool like curl to make the request:

curl -v "https://YOUR_APIGEE_GATEWAY_HOSTNAME/v1/test" \
  -H "x-apikey: YOUR_API_KEY"

Replace YOUR_APIGEE_GATEWAY_HOSTNAME with your actual hostname and YOUR_API_KEY with the consumer key you copied. The -v flag provides verbose output, showing request and response headers.

A successful response will typically return an HTTP 200 OK status code and content from mocktarget.apigee.net, indicating that your request passed through Apigee, was authenticated with the API key, and reached the backend target, as described in Apigee's proxy testing documentation.

Quick Reference: Getting Started with Apigee X

Step What to Do Where
1. Google Cloud Project Create a new project Google Cloud Console
2. Enable Apigee API Search for and enable "Apigee API" Google Cloud Console > APIs & Services > Library
3. Provision Apigee Instance Configure VPC network, then use Apigee X provisioning wizard Google Cloud Console > Apigee X > Provisioning
4. Create API Proxy Define a reverse proxy to a backend target Apigee UI > Develop > API Proxies
5. Generate API Key Create Product, Developer, and Developer App Apigee UI > Publish > API Products/Developers/Developer Apps
6. Make First Request Use curl with Gateway Hostname and API Key Terminal/Command Line

Common next steps

After successfully making your first API call through Apigee, consider these common next steps to further explore the platform's capabilities:

  • Apply Policies: Explore Apigee policies for security (e.g., OAuth 2.0, JWT verification), traffic management (e.g., rate limiting, caching), and mediation (e.g., JSON to XML transformation). These are configured within the API proxy flow Apigee policy reference. The OAuth 2.0 framework, for example, is a widely adopted standard for delegated authorization OAuth.net documentation.
  • Monitor API Traffic: Utilize Apigee Analytics to gain insights into API performance, traffic patterns, and error rates. The analytics dashboard provides customizable reports and real-time data Apigee Analytics overview.
  • Developer Portal: Set up a developer portal to onboard developers, publish API documentation, and manage API keys. Apigee offers integrated developer portal solutions to streamline API consumption Apigee developer portals.
  • Environments and Deployments: Understand how to manage different environments (e.g., dev, test, prod) and deploy API proxies to specific environments. This facilitates a structured API development lifecycle Apigee environments documentation.
  • Custom Domains: Configure custom domains for your API proxies to provide a branded and consistent API endpoint for consumers Apigee custom domains guide.

Troubleshooting the first call

If your first API call does not return the expected success, review these common issues:

  • Incorrect Gateway Hostname: Double-check that the YOUR_APIGEE_GATEWAY_HOSTNAME in your curl command exactly matches the hostname provided in the Apigee UI for your environment.
  • Invalid API Key: Ensure the x-apikey header contains the correct consumer key from your developer app. API keys are case-sensitive. Verify that the developer app is associated with the correct API product, which in turn includes your test-proxy.
  • API Proxy Not Deployed: Confirm that the test-proxy is deployed to the test environment. In the Apigee UI, navigate to "Develop" > "API Proxies", select your proxy, and check its deployment status.
  • Incorrect Base Path: Ensure the URL in your curl command uses the correct base path (/v1/test in this example) as configured in your API proxy.
  • Network or Firewall Issues: If you are running curl from a restricted network, ensure outbound HTTPS traffic to your Apigee Gateway Hostname is permitted.
  • Apigee Tracing: Use the Apigee Trace tool to inspect the flow of your API request through the proxy. In the Apigee UI, go to "Develop" > "API Proxies", select test-proxy, and click "Trace". Start a trace session and make your curl request. The trace tool will show policy execution, request/response headers, and any errors encountered during processing Apigee Trace tool documentation.
  • Backend Target Unreachable: Although mocktarget.apigee.net is generally reliable, ensure there are no temporary issues with the backend target. Apigee's trace tool can help identify if the request successfully reached the target or failed before.