How to get content types and field list with API?

Hello,
i would like to realize a dynamic application using strapi as backend.
I would like to define several content types with their fields in Strapi and then, in the frontend,
let the user choose between content types, then get the selected content type fields to build the query in GraphQL.
Is there a way (eg api call) to get the content types list? Something like GET /api/content_types and
GET /api/fields/contentType1 to get the fields or do i have to create my API that looks in database structure?

Thanks in advance and greetings
Cris

1 Like

Its outside of strapi. But there is another opensource solution. You can take a look GitHub - nocodb/nocodb: 🔥 🔥 🔥 Open Source Airtable Alternative - turns any MySQL, Postgres database into a collaborative spreadsheet with REST APIs..

I need this :sweat_smile:

there is a route for conentTypes and contentType /api/content-type-builder/content-types/:uid
uid will be ‘api::article.article’
or else you can call strapi.contentTypes[uid] from code

2 Likes

Hello,

Is it a problem that has been solved ? I am actually stuck on the same question. I have tried managing the route that nikant has posted but i keep getting a 403 Error. this is what i have tested : http://localhost:1337/api/content-type-builder/content-types/api::supplier-catalog.supplier-catalog

You need to give to the “Public” user role the permissions for “getContentType” and “getContentTypes”…

1 Like