You're viewing Apigee Edge documentation.
Go to the Apigee X documentation. info
The Apigee Edge API samples contains the sample API proxies, policies, code, and tools that illustrate the capabilities of Apigee Edge API Services described below.
For instructions on using the samples, see Using the sample API proxies.
Learn by doing
Want to get your hands dirty in a hurry and start building a solid knowledge base about Apigee Edge? We have a library of "learn-edge" samples in GitHub that let you quickly deploy, invoke, and trace some sample proxies, starting with the very simplest proxy and moving on to proxies that illustrate API key validation, quota, response caching, fault handling, and more.
Once you clone the repo and set up your environment (takes just a few minutes), you can try out each sample in less than a minute. And because each sample creates a new revision of the same proxy, your environment won't get cluttered with a lot of samples. You can switch revisions, redeploy a different revision in the management UI, and look at the proxy code any time. The readme for each sample also gives you a brief rundown of what the sample is doing and how it's set up.
Doc cookbook samples
A set of samples are provided for the API proxy cookbook topics.
|Simple hello world Java callout.
|Converts response content and headers to uppercase.
|Demonstrates how to use properties in a Java callout.
|Demonstrates error handling patterns that you can use in Java Callout code.
Sample API proxies
The following API proxies are located in GitHub, where the readme pages provide detailed descriptions of the samples. If you're interested in how a particular policy works in a sample, look in the Policy Types column below for the one you're interested in, then click the sample name in the Name column. (The policies are linked to their respective reference pages in the docs.)
Reference and Tools
In addition to the doc cookbook samples and sample proxies in the tables above, the Edge GitHub samples also contain these resources:
|The regular expression threat protection policy can protect your backend APIs and microservices from SQL injection attacks.
|You are implementing the OAuth Password grant type flow. You need to validate both the application client key and secret on Edge before calling an outside Identity Provider to validate the user's credentials.
|This proxy lets you easily try out and test conditional statements in an API proxy flow.
|Shows how to retrieve profiles for entities from the Apigee Edge datastore.
|Implements simple API key validation
|Implements simple conditional policy enforcement. When a request contains an HTTP header responsetime:true, a policy executes a Python script that adds a set of performance metrics to the response message, as HTTP headers
|Implements simple conditional routing in a slightly more complex scenario, that defines two URLs and one default route.
|This is the API proxy used by the Apigee doc team to generate release notes from Jira.
|This sample shows how to perform Kerberos Credential Mediation on Apigee Edge.
|Java JAR file
|A complete, working example of the authorization code grant type flow, with Apigee Edge as the authorization server.
|see the example code
|Demonstrates a fully functional OAuth 2.0 token endpoint configured for the client credentials grant type.
|Deprecated. We recommend that you look at the oauth-advanced sample instead.
|Illustrates a technique for validating the client's key and secret before calling an identity provider to validate user credentials in the password grant type flow.
|Demonstrates an API proxy that is configured to validate OAuth 2.0 access tokens and verify Quota.
|Demonstrates an OAuth 1.0a three-legged configuration.
|Uses the Microsoft Azure translator API to translate tweets. To do so, it makes an outbound call to obtain an OAuth access token, and then caches the token using the API Services caching policies, reusing the cached token each time an outbound call is made. Also, includes a demonstration browser app used to invoke the API proxy.
|Paginates an XML response message based on limit and offset parameters provided by the client
|Demonstrates how to cache weather forecasts on Edge for 10 minutes.
|Demonstrates a simple scenario of attaching a python script in the
response that adds a header value to it.
|Demonstrates an XSL transformation that rewrites a WSDL file in response to a request with the query parameter ?wsdl.
|Demonstrates an HTTP streaming configuration.
|Transforms timeline responses (e.g. from statuses/user_timeline.json) into an oEmbed response that contains the timeline data as rich HTML content.
|Demonstrates how to extract and set variables based on transport and JSON and XML message content.
|Converts response data from XML to JSON.
XML schema files that you can use as a reference when configuring API proxies, policies, API products, and developer and app profiles.
Contains a deployment tool, deploy.py, that imports an API proxy to an organization on Apigee Edge and then deploys it to the environment specified.
The organization snapshot tool retrieves organization settings, including developers, API products, virtual hosts, key/value maps, etc. It can be used to backup the details of an organization, or to discover the settings in an organization.
Share your experience
Share your experiences on the Apigee Developer Forum.