How to create a resource-path for a service?


#1

Hi,

I need to create a resource-path for my service, how can i do that?

thanks!


#2

@andersonmuller Can you provide some more information about the service? The layout of the API call in most cases follows the same convention seen in the DreamFactory Architecture guide (pg.5):

Following the service name is resource path. Any number of resources can be appended to the resource path but it all depends on how your service is laid out as well as how you would like to expose representations of the resource(s) REST-fully to the user.


#3

Hi @mattschaer,

Ok, for example purposes only, if I have a Custom Scripting Service called “my_service” and I want to create two resources: resource1 and resource2/{any_number}.
If I call my_service/resource1, the response is {“msg”:“hello world”}
And for my_service/resource2/3, the response is {“msg”:“I have 3 apples”}

Thanks!