You're viewing **Apigee Edge** documentation.  
[Go to the
**Apigee X** documentation](http://cloud.google.com/apigee/docs). info

> [!NOTE]
> **Note:** Apigee Extensions are available in the Edge UI to Google Cloud Apigee customers with an Enterprise [support](https://cloud.google.com/apigee/pricing) plan.

When developing an API proxy, you can add support for an extension by adding an
[ExtensionCallout policy](https://docs.apigee.com/api-platform/reference/policies/extension-callout-policy) to the proxy. (If you want help creating a simple proxy, see the
[Build your first proxy](https://docs.apigee.com/api-platform/get-started/get-started).)

When you add support for an extension, you're associating the ExtensionCallout policy with a
configured extension. That extension configuration's settings define how the extension interacts
with the backend resource it's connecting to. It's this specifically-configured extension that the
ExtensionCallout policy integrates into the API proxy.

> [!NOTE]
> The extension you want to add to an API proxy must already be configured and deployed to the environment where the API proxy will be deployed.

**To add an extension to your API proxy:**

1. Open your API proxy in the Apigee Edge console, in the **Develop** view.

   While you have to be an **organization administrator** to create an extension,
   any user role can add the extension to an API proxy.
2. In the **Navigator** pane, select the **PreFlow** .

   ![](https://docs.apigee.com/static/api-platform/images/extensions-proxy-select-flow.png)
3. In the upper right corner, click the **+ Step** button to add a policy.

   ![](https://docs.apigee.com/static/api-platform/images/extensions-proxy-add-step.png)
4. In the **Add Step** dialog, in the policy list at the left side, click **Extension Callout** .

   ![](https://docs.apigee.com/static/api-platform/images/extensions-proxy-add-step-add.png)

   If you don't see the ExtensionCallout policy in the list, be sure you're using the
   new Edge UI. In addition, Apigee Extensions is currently available to Apigee Edge Cloud
   Enterprise customers only.
5. In the right pane, select options to configure the policy:

   | Field | Description |
   |---|---|
   | **Display Name** | Enter the policy's display name. |
   | **Name** | Enter the name to use for the policy programmatically. This must be unique in the proxy. |
   | **Extension** | Choose the extension to use. This is the extension you configured earlier. |
   | **Actions** | Select the "log" action. |

6. Click **Add**.
7. In the flow view, click the policy to view its configuration XML. ![](https://docs.apigee.com/static/api-platform/images/extensions-proxy-select-policy.png)

   When you add the extension, you'll get example policy XML. Note that it includes schema
   describing how to structure configuration for the `<Input>` element. (You can ignore the
   `<Output>` element schema -- there's no response body returned by the
   extension "log" action.)
8. Edit your policy XML so that it looks like the following:

   ```
   <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
   <ConnectorCallout async="false" continueOnError="true" enabled="true" name="Extension-Callout-Beta-1">
     <DisplayName>Logging Extension</DisplayName>
     <Connector>my-logging-extension</Connector>
     <Action>log</Action>
     <Input>{
       "logName": "example-log",
       "metadata": {
         "resource": {
           "type": "global",
           "labels": {
             "project_id": "my-gcp-project"
           }
         }
       },
       "message": "This is a test"
     }</Input>
   </ConnectorCallout><!--
   Input JSON Schema for package=gcp-stackdriver-logging version=0.0.4
   {"type":"object","properties":{"logName":{"type":"string"},"metadata":{"type":"string"},"message":{"type":"string"}},"required":["logName","message"]}
   -->
   <!--
   Output JSON Schema for package=gcp-stackdriver-logging version=0.0.4
   {"type":"object","properties":{"content":{"type":"string"}},"required":[]}
   -->
   ```

   Here, the `<Input>` defines the following:
   - `logName` is the name of the log to write to. If this doesn't exist, it will be created by the extension.
   - `metadata` specifies information you can use to browse for the log in the Stackdriver console.
   - `message` is simply the log message you want to write.
9. Click the **Save** button.

> [!TIP]
>
> ### Congratulations!
>
> You've added an ExtensionCallout policy to your API proxy. Next, you'll deploy it.

### Next step

[Step 1](https://docs.apigee.com/api-platform/tutorials/add-extension/add-new-extension)
[Step 2](https://docs.apigee.com/api-platform/tutorials/add-extension/configure-for-testing)
[Step 3](https://docs.apigee.com/api-platform/tutorials/add-extension/extension-callout-policy)
[Step 4: Deploy the proxy](https://docs.apigee.com/api-platform/tutorials/add-extension/proxy-deployment)
[Step 5](https://docs.apigee.com/api-platform/tutorials/add-extension/xtra-credit)