Template URL in API

To retrieve certain data, we use an API. The endpoint consists of a template because a specific code needs to be included in the URL. The problem is that the template accesses the URL and then uses that result in the endpoint field.

To clarify, see the images below.

In the image above, the URL is shown. A code should appear in place of the *. However, the URL is apparently being requested, resulting in this outcome:

Because the entire content of the template is used, we don’t get the correct result.

Is there a way to construct a URL without accessing the link? Or can I set it up differently in the API?

Not sure I understand, but the template column is not requesting the url. As far as the template column is concerned, it’s just building text. You are replacing * with a JSON object, so the result is the url with the JSON object inserted into it. What does the column look like that you are using for the replacement of *?

The * is a code (in this case, 0268100000028624). It is inserted into the URL using the template, so https://public.ep-online.nl/api/v5/PandEnergielabel/AdresseerbaarObject/*/ becomes https://public.ep-online.nl/api/v5/PandEnergielabel/AdresseerbaarObject/0268100000028624/.

Because the template column displays the resulting URL, I cannot use the constructed URL in the API.

So the template generates this link (The result of the link is not the data we need):

While it should actually be just a simple URL: https://public.ep-online.nl/api/v5/PandEnergielabel/AdresseerbaarObject/0268100000028624/

Are you sure? So the value in whatever column this is, contains only a code and not a full json object?

You’re right! I selected the wrong column! Sometimes the solution can be so simple :sweat_smile:

Thanks for your help!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.