liveBook · Manning

Contract

As explained in Microsoft Azure in Action

An API is a defined interface through which software components request functionality or data from other software.

An application programming interface (API) is a defined way for software to request data or functionality from other software. Its contract tells a calling application what it can access and what inputs to provide. It is for software-to-software communication, not a graphical interface for people. section 8.1 section 8.6

An endpoint is one place to make a request. It is often a unique HTTP URL: send arguments to that address and receive a result. An API can collect multiple endpoints so another application has a managed way to use them. section 8.1 section 8.6

Figure 8.2 An API has endpoints, which are often HTTP URLs that can be accessed over the Internet.

The figure shows how an API endpoint gives callers a network address for a request. section 8.1

A shop shares NFT images

A web shop stores a reference and image when an NFT is created. A public-facing API can make those images accessible to partners who have been granted access. The partner connects through the API instead of needing the shop’s own interface. section 8.1

A contract can also reflect a familiar way of working with data. Azure Cosmos DB offers APIs for different data models: its MongoDB API lets an existing MongoDB application use its queries and drivers, while its Table API supports applications built for Azure Table Storage. Choose the interface that fits the application rather than treating every API as interchangeable. section 11.2.1

How Microsoft Azure in Action covers it

How deep it goes
Defines APIs and endpoints through inputs and HTTP URLs, then distinguishes Cosmos DB APIs by data model without specifying an interface schema.
Examples
Uses a power-calculation endpoint, partner access to NFT images, and Cosmos DB APIs for product, customer, and activity data.
What it assumes
Introduces APIs and endpoints through a simple input-and-result example before applying them to cloud services.
What you can do after
Evaluate/understand an API as a software interface and distinguish an HTTP endpoint from a data-model-specific Cosmos DB API.
How it connects
Links endpoints and HTTP to API Management, and links Azure Cosmos DB APIs to MongoDB and Azure Table Storage compatibility.

Also explained in

Compare how 44 books explain contract →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Microsoft Azure in Action. The section links point to the parts of the book it draws on.