What is API First?
With the API First approach, the specification comes first. It describes resources, data models, error models, and security mechanisms in a machine-readable format such as OpenAPI or RAML. OpenAPI emerged from the Swagger specification and is now maintained by the OpenAPI Initiative under the umbrella of the Linux Foundation. With code first, the description is derived from the finished implementation. With API First, the order is reversed. The contract is the starting point that implementation, tests, and documentation align with. The API Design page shows how we develop a specification.
The benefit becomes apparent as soon as several parties work on one interface. Once the contract is in place, teams can develop in parallel and test their side against example responses from the specification while the other side is still being built. This is how we connected SugarCRM and SAP R/3 for a publishing company. RAML fragments defined each business object once and were reused in all APIs. That kept the contracts between the parties involved stable, as the case study on the SugarCRM SAP integration describes.
API First in established system landscapes
API First also works where the systems have long been in place. At a multi-regional energy utility, a dedicated API encapsulates SAP IS-U. Every interface of the tariff comparison calculator was first designed as a RAML specification, and the implementation followed it. For an industrial company, we specified and documented the integration of business credit reports into SAP with OpenAPI. In both projects, the contract was in place before implementation began.