Consuming API - changing URL in different environments

Hi, I have created a API and want to consume it, when running it on local it is http://localhost<port>/v1/api and when checking alpha/beta it is http://<alpha/betaUrl>/v1/api. I want to consume this in another module of same project, how would I go about calling this api in Microflow, without changing the first part of URL? Do I have to get browser url and append v1/api to it?
2 answers

Hi Samim, 

I would say there are two ways how you could tackle this:

  1. Move the url host part to a mendix constant and change this constant in your different environments
  2. Get the host/url of your application via the “Get Application URL” action from the Community Commons.


Best regards,



Cant you simply make a sub microflow of your API action and call that with proper security permissions across modules? Do you really want to do this by calling webservice within the same project. Hope you understand the side-effects of this design.