#Hi a general question from beginner. Is it possibl...

35 messages · Page 1 of 1 (latest)

ebon spadeBOT
#

Hi a general question from beginner. Is it possible to use Directus as user interface to interact with my custom API instead of the extent database directly? Something like API bridging?.

Just so you know, we have moved your message here, @tiny plume. In future, please ask questions in one of the help channels as per the server rules.

@wide spruce was the person who moved it, so if there's aditional context, they will add it here for you. Your original post has been deleted.

#

Thanks for posting! This is a community powered server, so you may or may not get an answer based on available help and expertise. To increase your chances of somebody being able to help you, please help us help you making sure you:

  • Adding an explanation of exactly what you're trying to achieve.
  • Adding any and all related code or previous attempts.
  • Describing the exact issue or error you are facing.
  • Posting any screenshots if applicable.
  • Reading through https://stackoverflow.com/help/how-to-ask.

When you're done with this thread, please close it. Thanks! ✨

(If you have a support agreement and need help, please contact the core team via email.)

wide spruce
#

so for example to add new item to a collection, what it's supposed to do is to send the values and call an API endpoint instead of directly adding the item to database

#

That's exactly how it works, if I've understood your question correctly

#

You set up a Directus project and then get developer APIs to interact with

#

Incl CRUD operations

tiny plume
#

,Hi thank you for the answer. To be clearer, in my case I already have a database with its own API and I don't want to use a tool that interacts directly with our database, but instead with its API for CRUD operations. If Directus supports this can you please link me the documentations on how to achieve this?

wide spruce
#

Just to make 100% sure we're on the same page I'm going to repeat the question back at you:

You have a DB. You want to interact with the DB via an API. Will Directus let you do this?

tiny plume
#

ok, I want to interact with the DB via an API yes

#

like: making a request to get data via a custom API request instead of pulling things directly from the DB

tiny plume
#

if there's still confusion then let just say this:
What I want to know if Directus can work like this:

User <-----> Directus <---> Custom Database API <------> Database.

Instead of this:
User <-----> Directus API <----> Directus <----> Database

true jolt
#

Short answer: No.

Directus gives you an API for an SQL database.
It is not a proxy for other APIs.

But why would you even want this?
If you already have an API, why put another API in front of it, instead of using it directly?

wide spruce
#

Longer answer: yes. 😅

#

You can achieve this with custom endpoints.

#

In fact I just put a guide in a PR on how to proxy APIs with them. You could use Directus permission within them (legit use case for proxying an API)

tiny plume
#

for them to interact with database but not directly because we have a authentication layer which through API connecting to the database

wide spruce
true jolt
#

Well... Yes. Anything is possible with an endpoint of course.
But you still need a database for directus to connect to...

tiny plume
#

so maybe headless CMS isn't what I'm looking for then

wide spruce
#

Yeah I don’t think it is. You basically want a UI layer on an unrelated API

#

I think that’ll certainly be possible with Directus, but not today.

true jolt
#

Is there a reason why you can not connect directus to the database directly? You could host it on the same server

tiny plume
#

but I'm so tired of front-end work like making forms and stuff. I thought if I have API and database, headless CMS like Directus will handle the front end part for me. And I don't need another API layer. Is there any suggestion for a tool that might help my case pls recommend it to me

wide spruce
#

Maybe appsmith? I got shown their tool last week and it’s pretty slick.

tiny plume
#

Ok I also just read about it yes. It has the "Rest API" as an option for connecting to data source maybe that helps my case

tiny plume
#

Appsmith and Budibase seem to fill my requirements

west falcon
tiny plume
#

i'll take a look to see if it worth it to subscribe the business version

west falcon