How to update deployment URLs of an API proxy?

anton
Participant V

Hello,

I have added virtual hosts for my test and prod environments. When I call the new domains (e.g. https://api.freightos.com/shipping) I'm getting this error:

{"fault":{"faultstring":"Unable to identify proxy for host: api.freightos.com:443 and url: \/shipping","detail":{"errorcode":"messaging.adaptors.http.flow.ApplicationNotFound"}}}

When I call the apigee.net domain (e.g. https://freightos-prod.apigee.net/shipping), I'm getting this answer, which looks correct (e.g. the application found and all is well except the missing params):

{"fault":{"faultstring":"Failed to resolve API Key variable request.queryparam.apikey","detail":{"errorcode":"steps.oauth.v2.FailedToResolveAPIKey"}}}

I assume I had to change the API proxy as well, or similar... Not sure how to do it though.

I know that I can create a new proxy using the new virtual hosts, with a new API product etc. but what I really need is to use our new custom domains, without the need to create a new app in the portal that includes the new API product.

Thanks,

Anton.

0 8 1,107
8 REPLIES 8

Ah yes. I understand. What you need to do is:

  1. configure a virtualhost that includes api.freightos.com as a host alias. (read about it here)
  2. configure your API Proxy endpoints to "listen" on that virtualhost.

    <ProxyEndpoint name="endpoint1">
      <Description>Proxy Endpoint 1</Description>
      <HTTPProxyConnection>
        <BasePath>/shipping</BasePath>
        <Properties/>
        <VirtualHost>secure</VirtualHost> <!-- here -->
      </HTTPProxyConnection>
      ...

It's not necessary to create a new app in the developer portal.

There are a set of entities here, so let's take our time. API keys are issued as part of Developer Apps. A Developer App relates a Developer to an API Product. And the API Product wraps one or more API Proxies. API Products *may* be restricted to particular environments.

As long as the virtualhost you configure (with the api.freightos.com host alias) is present in an environment which is valid for the API Product, then the API key will still work with the new hostname.

Does this answer your question?

If you need more detail on the vhost / host alias thing, LMK.

Where in the GUI I should set the XML you mentioned here?

Anton, that is in the proxy endpoint. Open your proxy in the proxy editor. Click the develop tab.

Then, you can modify the proxy endpoint.

6071-vhost-proxy-endpoint.png

An API Proxy bundle may have more than 1 proxy endpoint. If you have more than one proxy endpoint in your proxy bundle, be sure to mark all of them with that virtualhost.

Thanks for the explanation, now I have a new set of issues. This is not a pleasant experience, to be honest. I'm getting time outs on saving the proxy and the API stopped responding for all the developers!!!

6078-2017-12-07-09-05-35-freightos-apigee.png

This is what I'm getting now:

6079-apigee-error-sending-request.png

This is how Postman describes the issue: SSL Error: UNABLE_TO_VERIFY_LEAF_SIGNATURE

6080-ssl-error.png

Hi Anton

I'm sorry about the problems

This seems like a totally new issue from the one you originally described here. Probably not appropriate to raise a totally new issue in a comment buried 4 levels deep in a conversation.

Also it seems like something I won't be able to help with. I suggest you open a call with Apigee Support.

I really am sorry that you seem to be having such trouble getting things done. I'm sure it's quite frustrating for you.

OK, Mark from your Support team has resolved the issue.