Skip to content

Latest commit

 

History

History

composite-api

Composite API


This sample shows how to implement composite APIs (e.g. mashup) using Apigee's ServiceCallout Policy and ExtractVariables Policy

Let's get started!


Prerequisites

  1. Provision Apigee X
  2. Configure external access for API traffic to your Apigee X instance
  3. Access to deploy proxies, create products, apps and developers in Apigee
  4. Make sure the following tools are available in your terminal's $PATH (Cloud Shell has these preconfigured)

(QuickStart) Setup using CloudShell

Use the following GCP CloudShell tutorial, and follow the instructions.

Open in Cloud Shell

Setup instructions

  1. Clone the apigee-samples repo, and switch to the composite-api directory
git clone https://github.com/GoogleCloudPlatform/apigee-samples.git
cd apigee-samples/composite-api
  1. Edit env.sh and configure the following variables:
  • PROJECT the project where your Apigee organization is located
  • APIGEE_HOST the externally reachable hostname of the Apigee environment group that contains APIGEE_ENV
  • APIGEE_ENV the Apigee environment where the demo resources should be created

Now source the env.sh file

source ./env.sh
  1. Deploy Apigee API proxies
./deploy-composite-api.sh

Testing the Proxy

To run the tests, first retrieve Node.js dependencies with:

npm install

and then run the tests:

npm run test

Cleanup

If you want to clean up the artifacts from this example in your Apigee Organization, first source your env.sh script, and then run

./clean-up-composite-api.sh