Solved

How to get an entry without knowing its content type

  • 14 October 2022
  • 1 reply
  • 221 views

Userlevel 2
Badge +1

Hi,

We have a complex website where entries for different content types can be created under any URL prefix.

We’d like to know if it’s possible to get an entry via Delivery API / SDK based only in the URL. This is because, when a page is requested to the app, the frontend has no way to know which content type that entry belongs to, just its URL.

We’ve seen examples, like in the starter app, where you know beforehand that any entry under /blogs url prefix will be of a known content type. Well, this is not our case, we can have a sitemap similar to this:

Where /abc and /def can be entries based on any of our page content types.

We checked the API documentation, but every endpoint returning entries requires the ‘content_type’ parameter.

Thanks!

icon

Best answer by Sachin 15 October 2022, 08:37

View original

1 reply

Userlevel 3

Hi @jajimene , 

Hope you are doing great!

Currently we do not have the provision to fetch entries based only on the URL prefix. Since an URL field exist inside an entry and it would be a part of Content type, hence content_types parameter is a mandatory designed as a part of our APIs and SDKs.

Regards,

Sachin.

Reply