How do I know the url I need to call an api deployed in CloudHub using anypoint platform? (MuleSoft)

569 views Asked by At

I want to make a request to another api deployed in cloudhub but I am not sure how to call it because I don`t know where is the url,is it possible to get in anypoint platform?

2

There are 2 answers

2
jarus On

If your application is deployed on CloudHub with a shared load balancer, you can find the URL by navigating to Anypoint Platform → Runtime Manager → Your Application → Settings → App URL (host name).

In the case of CloudHub 1.0, the App URL typically has the format: <app_name>.<region_code>.cloudhub.io

Your request URL should be formatted like this: <protocol>://<app_url>/<resource or endpoint>

Please note that your application, deployed in CloudHub, must be listening on host 0.0.0.0 and either the HTTP port (8081) or the HTTPS port (8082).

0
Rahat Rajdev On

Yes, obtaining the app URL from the Anypoint platform is entirely feasible. To do so, follow these steps:

  1. Log in to the Anypoint platform.
  2. Navigate to the "Runtime Manager" section.
  3. Locate your application's name and click on it.
  4. Access the "Settings" menu.
  5. You will find the App URL displayed, as illustrated in the image below.

enter image description here

However, it's important to note that merely knowing the application URL isn't sufficient for making calls to it. You must also be aware of whether it operates over HTTP or HTTPS protocols and the specific resource or endpoint it listens to. If any policies are enforced on that API, such as client ID requirements, you should be familiar with those details as well.

Assuming the application is accessible over the public Internet and is using the HTTP protocol, if your app URL is "test123.us-e2.cloudhub.io" and it listens on the "hello" resource or endpoint, the correct URL format would be http://test123.us-e2.cloudhub.io/hello

For a more comprehensive understanding, I recommend performing a Proof of Concept (POC) in your personal account and attempting to call the application using a REST client like Postman.

You might also find this informative YouTube video helpful in gaining a better grasp of the process; I encourage you to watch it.

Once you've successfully invoked the API outside of MuleSoft to ensure its functionality, you can utilize the HTTP Request connector to make calls to that API.

For detailed instructions on configuration, please consult the following documentation and refer to this informative YouTube video.

HTTP Request Connector

Configure HTTP Request Operation

CALL EXTERNAL HTTP REST API

Thank you!