Was this Helpful?

Apigee provides a set of samples on GitHub that you can download and run locally.

Prerequisites

The samples require you to have an account on http://enterprise.apigee.com. You can sign up for a trial account at http://accounts.apigee.com/accounts/sign_up.

For more information on creating accounts, see Creating an Apigee Edge account.

To use samples, you should also install Git and Python.

Git

The samples that are located on GitHub. If you do not have Git installed, please refer to GitHub's git setup instructions. If you don't want to install Git, you can browse the files and download a ZIP from https://github.com/apigee/api-platform-samples.

Python

Python is required to run the Apigee deploy tool. Python is present in most Linux environments, on a Mac with XCode installed, on a Windows machine with Cygwin installed, and in many other places.

To obtain Python, please refer to the Python installation instructions.

Downloading and deploying the samples

Use the following procedure to download and deploy the samples:

  1. To obtain the sample files, run:

    $ git clone https://github.com/apigee/api-platform-samples.git
  2. After you download the samples, go to the /setup directory.

    $ cd setup
  3. In the /setup directory, locate the file setenv.sh. Edit this file to set your organization, the email address associated with your username, and the environment (prod or test) where you want to deploy the API proxies.
     
  4. After you edit setenv.sh, run:

    $ sh deploy_all.sh
    This script deploys all API proxy samples to your organization. (The process takes 3-4 minutes.) Follow prompts to deploy API products, developers, and apps (which are used for OAuth).
     
  5. After the deploy script completes, navigate to the sample-proxies directory. In the directory sample-proxies, you will find one directory per sample proxy. In each directory is a README.md file with information about running the sample, and two scripts that help you as you make small changes to the samples, deploy, and then invoke the sample to see what effect you change had:
    • invoke.sh: Run this script to invoke the deployed version of the API proxy.
    • deploy.sh: Run this script to deploy the API proxy after you make any changes.
       
  6. Try the apikey sample. This sample shows how to perform a simple "API key" style of API security using Apigee. Change to the sample-proxies/apikey directory:

    $ cd sample-proxies/apikey
  7. Invoke the sample:

    $ sh invoke.sh
    You will be prompted to enter your password. The sample then displays information about the app used to make requests to the API, displays the API key used to access the API, makes a request to the API using the key, and then makes a request using an invalid key.

You can continue to work in the samples, move on to the tutorials at Part 1: Create your API, or start building your first APIs at Build a simple API proxy.

For more information on the samples

For more information, see:

 

Help or comments?

  • Something's not working: See Apigee Support
  • Something's wrong with the docs: Click Send Feedback in the lower right.
    (Incorrect? Unclear? Broken link? Typo?)