liveBook · Manning

Endpoint

As explained in Building Web APIs with ASP.NET Core

An endpoint is a network-accessible entry point through which a web API exposes an operation or resource.

An endpoint is a network-accessible entry point of a web API. Clients use endpoints through HTTP and formats such as JSON or XML to interact with exposed data or operations. section 1.1

In ASP.NET Core, an endpoint can be implemented as a controller action or a Minimal API route. For example, /auth/test/4 can be restricted to authenticated users with the SuperAdmin role. section 9.5.4 section 11.2.7

Treat endpoints as both working API entry points and documented contracts:

  • Create operations such as Account/Register for user creation. section 9.5.2
  • Protect sensitive operations by declaring authorization requirements. section 9.5.4 section 11.5
  • Group related endpoints by controller or explicit OpenAPI tags so SwaggerUI remains navigable. section 11.2.7
  • Document inputs, responses, samples, and authorization requirements for clients and implementers. section 11.5

A protected test endpoint

Map /auth/test/4 with Minimal API and require the SuperAdmin role. A related Minimal API endpoint can receive the Auth tag so SwaggerUI places it with authorization-related operations. section 9.5.4 section 11.2.7

app.MapGet("/auth/test/1",
    [Authorize]
    [EnableCors("AnyOrigin")]
    [SwaggerOperation(
Tags = new[] { "Auth" }, #1
        Summary = "Auth test #1 (authenticated users).",
        Description = "Returns 200 - OK if called by " +
        "an authenticated user regardless of its role(s).")]

Inspect the Minimal API mapping pattern, authorization attribute, CORS setting, Swagger tag, summary, and description together. section 11.2.7

How Building Web APIs with ASP.NET Core covers it

How deep it goes
Demonstrates routes, Minimal API and controller organization, authorization, and OpenAPI grouping, but not endpoint runtime internals.
Examples
Uses Account/Register, /auth/test/4, controller-based groups, and SwaggerUI endpoint tags as concrete examples.
What it assumes
Assumes HTTP-based web APIs and JSON/XML interfaces, while introducing controller and Minimal API endpoint organization.
What you can do after
Build it from scratch via ASP.NET Core routes or controllers, secure operations, and organize their Swagger/OpenAPI documentation.
How it connects
Connects endpoints with HTTP, JSON/XML, controllers, Minimal API, authorization, OpenAPI, Swagger, and Swashbuckle.

Also explained in

Compare how 26 books explain endpoint →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building Web APIs with ASP.NET Core. The section links point to the parts of the book it draws on.