166
Views
3
Comments
Absolute URL of API
Question

I have exposed a REST API containing 2 REST API methods.

1) POST https://example.com/entities - this will create an entity.

2) GET https://example.com/entities/123 - this will return an entity.

The POST method will return the URL of the GET method as a output header parameter.

How do I generate the URL for the GET method? I don't want to hard code the absolute URL.


mvp_badge
MVP
Rank: #18

Hi,

In service center you can configure this on the  administration- espace - integration tab per environment.

You can also create on your API an onBeforeRequest event and set it using your own logic.

Regards,

Daniel

mvp_badge
MVP
Rank: #18

The only place where you can customize your request prior to it being sent is the onBeforeRequest event of your service.

In the logic tab scroll down to REST and select the consumed webservice (not the method but the top level one).
In the right bottom of your screen (properties tab) you can see a few settings, under the advanced header you can find on before/after request methods, which you can add by pressing the dropdown arrow and selecting to add a new method.