# specifying proxy endpoint

**URL:** <https://discuss.google.dev/t/specifying-proxy-endpoint/6700>\
**Category:** Apigee\
**Tags:** api-runtime\
**Created:** [February 4, 2015, 4:40pm UTC](https://discuss.google.dev/t/specifying-proxy-endpoint/6700 "2015-02-04T16:40:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhatikuldeep](https://d3byx8b92xw3lq.cloudfront.net/user_avatar/discuss.google.dev/bhatikuldeep/32/106827_2.png) [@bhatikuldeep](https://discuss.google.dev/u/bhatikuldeep)\
**Post date:** [February 4, 2015, 4:40pm UTC](https://discuss.google.dev/t/specifying-proxy-endpoint/6700/1 "2015-02-04T16:40:11Z")

</div>

is there a way in apigee to handle multiple endpoint efficiently rather hard coding for each resource call with assign message policy at target end point?

---

<div class="post-metadata">

**Author:** ![divyaachan](https://avatars.discourse-cdn.com/v4/letter/d/65b543/32.png) [@divyaachan](https://discuss.google.dev/u/divyaachan)\
**Post date:** [February 4, 2015, 8:55pm UTC](https://discuss.google.dev/t/specifying-proxy-endpoint/6700/2 "2015-02-04T20:55:23Z")

</div>

Could you please elaborate your question a little bit more. Are you asking how to define a single api proxy with different proxy endpoint or a single proxy routing to different targets endpoints based on some condition?

---

<div class="post-metadata">

**Author:** ![jonesfloyd](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@jonesfloyd](https://discuss.google.dev/u/jonesfloyd)\
**Post date:** [February 4, 2015, 9:25pm UTC](https://discuss.google.dev/t/specifying-proxy-endpoint/6700/3 "2015-02-04T21:25:18Z")

</div>

Hi Kuldeep - If you’re wanting to set up dynamic routing to different endpoints, check out this topic: [http://apigee.com/docs/api-services/reference/api-proxy-configuration-reference](http://apigee.com/docs/api-services/reference/api-proxy-configuration-reference)

---

<div class="post-metadata">

**Author:** ![anonymous8](https://avatars.discourse-cdn.com/v4/letter/a/7cd45c/32.png) [@anonymous8](https://discuss.google.dev/u/anonymous8)\
**Post date:** [February 5, 2015, 8:27pm UTC](https://discuss.google.dev/t/specifying-proxy-endpoint/6700/4 "2015-02-05T20:27:33Z")

</div>

To add to Floyds reference - you can use any information you have available in the request - query params, headers, uri, etc to create route rules to target servers.

We have a client that requires that different target servers be invoked based on regions around the globe. In that case they have a URI structure that includes a couple of variables that we use in RouteRules.

For example the URI path of /us/v1/profile/me/catalog/foo/123 will route traffic to a different target server than /uk/v1/profile/me/catalog/foo/123. The variables for this are resolved in an extract policy that looks like this:

```auto
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<ExtractVariables async="false" continueOnError="true" enabled="true" name="extractCatalogVariables">
    <DisplayName>extractCatalogVariables</DisplayName>
    <Variable name="request.uri">
    	<!-- work from most specific to least specific-->
        <Pattern>/{region}/{version}/profile/*/catalog/{catalog.type}/{catalog.id}</Pattern>

```

Route rules in the default proxy flow then can make decisions about where to send the target request using the region variable:

```auto
<RouteRule name="catalog-us">
        <Condition>(region == us)</Condition>
        <TargetEndpoint>catalog-us</TargetEndpoint>
</RouteRule>

```

---

<div class="post-metadata">

**Author:** ![bhatikuldeep](https://d3byx8b92xw3lq.cloudfront.net/user_avatar/discuss.google.dev/bhatikuldeep/32/106827_2.png) [@bhatikuldeep](https://discuss.google.dev/u/bhatikuldeep)\
**Post date:** [February 11, 2015, 10:12am UTC](https://discuss.google.dev/t/specifying-proxy-endpoint/6700/5 "2015-02-11T10:12:57Z")

</div>

Divya,

Thanks for the response, I in fact meant first - “how to define a single api proxy with different proxy endpoint”, but do not see any harm in knowing second one as well 😛

---

<div class="post-metadata">

**Author:** ![divyaachan](https://avatars.discourse-cdn.com/v4/letter/d/65b543/32.png) [@divyaachan](https://discuss.google.dev/u/divyaachan)\
**Post date:** [February 20, 2015, 6:54pm UTC](https://discuss.google.dev/t/specifying-proxy-endpoint/6700/6 "2015-02-20T18:54:55Z")

</div>

Kuldeep,

In order to define a single apiproxy, you need to first create an apiproxy with some basepath.

Once the apiproxy is created, you then need to add a ‘New Endpoint’ under the proxy endpoint section.

In the new Proxy endpoint you would need to define the Basepath of this new Proxy endpoint.

Attached is the screenshot.

 ![133-screen-shot-2015-02-20-at-105131-am.png](https://d2yds90mtvelsl.cloudfront.net/original/3X/7/4/746b5e1309e6b5c520e6ee6b5dba25015efe5b46.png)

---

<div class="post-metadata">

**Author:** ![bhatikuldeep](https://d3byx8b92xw3lq.cloudfront.net/user_avatar/discuss.google.dev/bhatikuldeep/32/106827_2.png) [@bhatikuldeep](https://discuss.google.dev/u/bhatikuldeep)\
**Post date:** [July 22, 2015, 9:25am UTC](https://discuss.google.dev/t/specifying-proxy-endpoint/6700/7 "2015-07-22T09:25:30Z")

</div>

thanks a lot [@Divya Achan](https://community.apigee.com/users/147/divyaapigeecom.html) [@David Allen](https://community.apigee.com/users/715/dallen.html) [@Floyd Jones](https://community.apigee.com/users/202/fjonesapigeecom.html)

---

<div class="post-metadata">

**Author:** ![anonymous8](https://avatars.discourse-cdn.com/v4/letter/a/7cd45c/32.png) [@anonymous8](https://discuss.google.dev/u/anonymous8)\
**Post date:** [July 23, 2015, 3:30pm UTC](https://discuss.google.dev/t/specifying-proxy-endpoint/6700/8 "2015-07-23T15:30:58Z")

</div>

Hi I have similar type of question just like above. I am new to apigee, I want to place the API proxy on this platform for my API.

I wanted to take the parameter from the proxy url and change the Target endpoint path.

For Example.

[http://proxy-server/{category}](http://proxy-server/%7Bcategory%7D)

to

[http://target-server/categories/{category}/products](http://target-server/categories/%7Bcategory%7D/products).
