Duplicate Resource API response

Good morning

We’re working on separating the response of the resource api in two different calls, one which would return static/common content for all the pages in the site (such as header or footer) and one which will return the content for each specific page (similar to the current behaviour, but excluding the content which will be the same for all pages)

Is there a way to separate the delivery api behaviour or to recreate it in a separate URL where a custom response would be delivered while maintaining the current one?

Greetings, Francisco

Yes should be possible, however not really recommend. Can you elaborate a bit on why you would like to do this?

You could split up the page layout into 2 pieces. One is the common part, which you could create an api endpoint using routes e.g. /common

and the other routes (/*) are reserved for the other pages in which you only retrieve the content. You will need to build in some custom logic in the frontend to make this work though.

Hi @kenan

The actual scenario is as follows, when visiting the page “localhost:8080/site/channel/resourceapi” we get a response along these lines: (of course for each of the pages in the site the “content” would change)

The idea would be to split the output in two, in a way that the “common” part, such as the header, footer, channel info, etc would be returned on a separate route (for example “common” as you say) and in the “resourceapi” route return only the content specific for each page. So for example for pages such as "“localhost:8080/site/channel/resourceapi/news1”, "“localhost:8080/site/channel/resourceapi/news2” only the content which is specific for that page will be shown and in the ““localhost:8080/site/channel/common”” route the common content would be returned

As for the front end custom logic, is something we already had in mind, still, thanks for mentioning it