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.
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 }...
<?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" ] }, ... }
Apigee Management API Reference: https://apidocs.apigee.com/apis