Contents
Can you have multiple endpoints?
4 Answers. A service may have multiple endpoints within a single host, but every endpoint must have a unique combination of address, binding and contract.
What is resource and endpoint in API?
The terms resource and endpoint are often used synonymously. The term endpoint is focused on the URL that is used to make a request. The term resource is focused on the data set that is returned by a request. Now, the same resource can often be accessed by multiple different endpoints.
What are multiple endpoints?
Multiple Endpoints in Clinical Trials Guidance for Industry January 2017. Most clinical trials performed in drug development contain multiple endpoints to assess the effects of the drug and to document the ability of the drug to favorably affect one or more disease characteristics.
Why are redundant endpoints bad for the API?
Redundant endpoints also increase the surface of our API, and while more readable URLs for our resource relationships are a good thing for developer experience, a giant amount of endpoints is not. Multiple endpoints increase the effort for the API owner to document the whole thing and make onboarding for new customers much more troublesome.
Why do REST APIs have multiple endpoints?
Take into account that REST API are contracts. Once in production, changing these contracts can be really challenging. Overall if we are enforced to support backward compatibility. Having to maintain YAGN-ish code reverts against our interest, so it’s preferable to release only functional code.
Is it bad idea to support multiple endpoints for a single resource?
However, it also makes sense to be able to view a single question with an endpoint like: Is it a bad idea to support additional endpoints for a single resource? If it is a bad idea, I think I’d rather have complex endpoints for collections and single resources because it seems inconsistent to simplify just one endpoint and have the following:
Do you have to use nested resources in REST API?
While nesting is sometimes necessary and can’t be avoided, it is often a choice that comes with specific costs or dangers we should keep in mind. Let’s look at them one-by-one. We learned before that nesting resources could make our URLs more readable, but this isn’t a sure bet.