Getting started with Apigee Integration and Apigee proxy Integration targets

You're viewing Apigee X documentation.
View Apigee Edge documentation.

This tutorial shows you how to use the Apigee X proxy wizard to create a proxy with an Integration target. The Apigee proxy utilizes an API Trigger reference from an existing integration to initiate the sequence of steps in the integration.

The steps below describe how to configure the Integration target, Apigee Integration trigger, and Apigee Integration tasks required to run a successful integration when the Apigee proxy is called.

Before you begin

Before beginning the tutorial:

  • Confirm your Apigee login credentials and organization details. This information is required to access the Integration feature and Proxy Wizard within the Apigee UI.
  • Create and publish an integration with an API Trigger and at least one task.
    • If you have not yet created an integration that uses an API Trigger, follow the steps in Getting Started with Apigee Integration.
    • Note the name of the integration you create, or the existing integration that you would like to use, as this is used in a later step.

Create an Apigee proxy

To trigger your integration with an Apigee proxy, you need to create an Apigee target endpoint and provide your integration and trigger information to the target.

Create an Integration target

Use the following steps to create an Integration target in the Apigee UI:

  1. Go to the Apigee UI and sign in.
  2. Select your organization using the drop-down menu in the upper left corner of the UI.
  3. Click Develop > API Proxies.
  4. Click Integration target from the display of proxy types.
  5. In the Create Proxy configuration window, provide the following details:
    • Name: Enter a name for the proxy. Proxy names can contain alphanumeric characters, dashes, and underscores.
    • Description: (Optional) Enter a brief description of the proxy. For example, Proxy test for Apigee Integration.
    • Integration target: Use the drop down selector to select the name of the integration you created in an earlier step.
    • Trigger: Use the drop down selector to select the API Trigger associated with the integration you selected.
    • Endpoint type: Select Sync.
  6. Click Next.
  7. In the Common policies configuration page, leave the default selections and click Next.
  8. In the Summary page, click Create.

Configure auth for the proxy

Use the following steps to edit the proxy and provide an access token:

  1. After the proxy creates successfully, click the Edit proxy button to display the proxy OVERVIEW page.
  2. Click the Develop tab.
  3. From the proxy Navigator pane, select set-request-payload under the Policies heading. This will display the policy's XML. Under the HEADERS element, you should see the REPLACE_WITH_AUTH_TOKEN variable in the XML body.
  4. Generate an access token:
    • Open a terminal window.
    • Run the following command: gcloud auth print-access-token
    • Copy the printed access token.
  5. In the Apigee proxy Navigator pane, replace REPLACE_WITH_AUTH_TOKEN with the printed access token.
  6. Select PreFlow under the Target Endpoints header in the proxy Navigator pane.
  7. Comment out or delete the entire <Authentication/> block, as shown in the image below:

Update the proxy request payload

Use the following steps to update the proxy request payload:

  1. From the proxy Navigator pane, select set-request-payload under the Policies heading.
  2. Uncomment the <Payload/> block.
  3. Remove the parameters key/value pair from the JSON payload. For example, the resulting block should look like this:
    <Payload contentType="application/json">
        {
            "name": "projects/apigee-gcp-integ-int1/locations/-/integrations/my_test1",
            "trigger_id": "api_trigger/my_test1_API_1"
        }
    </Payload>
  4. Click Save.

Deploy the proxy

To deploy the newly created proxy:

  1. From the Develop tab for the proxy, click Deploy to: prod. If the prod environment is not displayed as the selected option in the Deploy to: button, use the drop-drown environment selector to find and select prod.
  2. Click Deploy in the confirmation dialog.

Test the Integration target

Use the following steps to invoke the proxy and trigger the integration:

  1. From the terminal window, run the following command, where:
    • ORG_NAME is the name of the Apigee X org provisioned for access to the Apigee Integrations feature.
    • ENV_NAME is the name of the environment where you are deploying the proxy. In this case, prod.
    • PROXY_NAME is the name of the proxy you just created.
    curl -k https://ORG_NAME-ENV_NAME.hybrid.e2e.apigeeks.net/PROXY_NAME"

    For example:

    curl -k https://my-org-prod.hybrid.e2e.apigeeks.net/my-proxy"
  2. When prompted, enter y to execute the command.

To confirm that the integration was trigger by invoking the proxy:

  1. Open the Apigee UI.
  2. Click Develop > Integrations.
  3. Search for or select the name of the integration created in the steps above and click the integration name.
  4. Click Logs.
  5. Verify that an execution log exists for the triggered integration. To see the log details, click the row to expand the execution details.

What's next