REST API based on a number of services


#1

I am sorry if my question is a basiс question. I am new in Dreamfactory.

I have a number of data sources. Some of them are SQL and I can create SQL Services. Some of them are NoSql and I can create corresponded services for them. Some of them are external REST services.
Let’s say that all data provided by all these services belong to one type of objects and we have common set of IDs.
Is there a way to publish aggregated GET REST service which will provide full set of fields/values for specific IDs provided by multiple services?

What is a best practice for my issue and how it should be realised using Dreamfactory?


#2

Don’t know if I understand what you’re asking and don’t know if is the “best pratice”, but you could create a custom script that connect to all services and return those values.

For example, in your custom script:

clients_sql = platform.api.get('db/clients');
clients_other_service = platform.api.get('host_to_service/clients');

return {
  "some_clients":clients_sql,
  "more_clients":clients_other_service
}

where db/clients and host_to_service/clients are services in your dreamfactory or other rest.