Answer the question
In order to leave comments, you need to log in
How to name resources in API?
The application has an api application, it has a module v1. At the moment, the API is accessed like this: /api/v1/customer/
But what if you need to combine 2 api: my application and the application that my server works with (via api)?
/api/v1/customer/get-uniq-results
/api/v1/anotherservice-customer/get-uniq-results
/api/v1/my-service-anotherservice-customer/get-uniq-results (mix results).
Answer the question
In order to leave comments, you need to log in
I would leave /api/v1/customer/get-uniq-results
You can specify through which service to receive the result like this /api/v1/customer/get-uniq-results?service=my-service
and/or wait for the service parameter via POST,
and inside the customer method, depending on the service parameter, call my-service or anotherservice
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question