Rest – One or many RESTful APIs for large company

apiapi-designrest

I work for a large company which has several non-RESTful APIs. I am tasked with building a web application to interact with these APIs. Each API handles and provides very different business processes and data.

I'd like to build RESTful (a) interface(s) fronting the APIs so as to make them reusable by other future web applications. Then, I'd like JavaScript to interact with the RESTful interface(s).

Should I build one RESTful API (one subdomain) for my entire company

http://api.mycompany.com
    /business_process_1/resource/
    /business_process_2/resource
    /business_process_3/resource

and make it front the very different business processes and data? Or, should I build multiple APIs (multiple subdomains)?

http://business-process-1.mycompany.com
http://business-process-2.mycompany.com
http://business-process-3.mycompany.com

Best Answer

The key question here is whether your company is liable to sell/divest any of its divisions or products?

If the answer is yes then you probably want to have a url per brand or per product. If your company is a "single product" company then a single URL is the way to go.

Related Topic