API proxies maintain base paths in two different locations

In Apigee API proxies base paths are defined in two different locations. As a result, you may find it difficult to read that information via the Management API. In this article I will explain the locations where those base paths are defined and how to read them through the Management API.

1. The " Basepaths" property defined in API proxy properties:

Example:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<APIProxy revision="2" name="Foo-Proxy">
<Basepaths>/foo</Basepaths>
...
<ConfigurationVersion majorVersion="2" minorVersion="0"/>
<CreatedAt>---masked---</CreatedAt>
<CreatedBy>---masked---</CreatedBy>
<Description/>
<DisplayName>Foo-Proxy</DisplayName>
...
</APIProxy>


On the Apigee UI API proxy details page, you will find API proxy properties when you click on the API proxy name: Develop -> API Proxies -> [API Proxy] -> DEVELOP Tab -> Navigator -> [API Proxy]. This " Basepaths" property value is a plain text property field and it will not reflect the base paths defined under Proxy Endpoints. It is used for documentation purposes. This property value can be read using the below Management API endpoint:

GET /organizations/$ORG/apis/Foo-Proxy/revisions/2
{
"basepaths": [
"/foo"
],
"configurationVersion": {
"majorVersion": 2,
"minorVersion": 0
}...

2. The base paths given in Proxy Endpoints:


Example:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ProxyEndpoint name="default">
...
<HTTPProxyConnection>
<BasePath>/foo/v2</BasePath>
<VirtualHost>secure</VirtualHost>
</HTTPProxyConnection>
...
</ProxyEndpoint>

The base paths given under Proxy Endpoints are used for routing API requests to relevant proxy endpoints. These values can be read using the below Management API endpoint:

GET /organizations/$ORG/apis/Foo-Proxy/revisions/2/proxies/default
{
"connection": {
"basePath": "/foo/v2",
"connectionType": "httpConnection",
"properties": {
"property": []
},
"virtualHost": [
"secure"
]
},
...
}

References:

Apigee Management API Reference: https://apidocs.apigee.com/apis

Version history
Last update:
‎05-17-2021 05:12 PM
Updated by: