Step 4: Change the target endpoint

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

Now that you've tested your new proxy, you're almost ready to add a policy to it. Before you do that, though, change your proxy's target endpoint to one that returns some data.

Recall that in Step 1: Create an API proxy, you set the target endpoint (in the Existing API field) to Well, that endpoint doesn't return any interesting data, so now you'll change the endpoint to one that returns some XML.

To change your proxy's target endpoint:

  1. Sign in to the Apigee UI.
  2. Select Develop > API Proxies.
  3. Select your proxy from the list to display the API proxy details. If you don't see your proxy in the list, be sure that you selected the right organization, as described in Switching between your organizations.
  4. Click the Develop tab:

    This takes you to the API Proxy Editor. The Proxy Editor lets you see the structure of your API proxy and configure its flow. (A flow is just the stepwise path an API proxy request takes through the Apigee platform. Other tutorials will cover the concept of flows.)

  5. In the Navigator pane, select Target Endpoints > default > PreFlow:

    Apigee displays the endpoint settings in the Code pane:

    <TargetEndpoint name="default">
      <PreFlow name="PreFlow">
      <PostFlow name="PostFlow">

    The target endpoint is defined by the <HTTPTargetConnection> element.

  6. Change the URL to "". (Append "/xml" to the existing URL.)

    The new URL returns a small block of XML in the body of the response.

    Your endpoint configuration should now look like the following:

  7. To save your changes to the proxy configuration, click the Save button.

    Apigee saves your changes in a new proxy revision.

  8. To deploy the new revision, select Deploy to: test and click Deploy 2.
  9. In the confirmation dialog, click Deploy.

    If there is an error, Apigee will save your changes but not deploy the proxy. In the case of an error:

    1. Fix your proxy configuration. Apigee may provide syntax guidance as a pop-up.
    2. Manually deploy your changes to the test environment by clicking Deployment > test if Apigee does not automatically deploy it.

    You can check if your proxy revision was deployed successfully by viewing the deployment revision status adjacent to the Deploy drop-down. For example:

  10. Test your changes by sending a request to your proxy, just like you did in Step 3: Test the API proxy. For example:

    curl https://$EXTERNAL_IP/myproxy

    For example:

    curl | xmllint --format -

    This time, the mocktarget endpoint returns XML in the body of the response:

    <?xml version="1.0" encoding="UTF-8"?>
      <city>San Jose</city>

Now that the API proxy returns XML data, in the next step you will add a policy that converts XML to JSON.

Next step

1 2 3 4 (NEXT) Step 5: Add a policy