Understanding APIs in Business Central: How REST, OData, GraphQL, and SOAP Fit Together

The hierarchy (conceptual layers)

1. API (highest level)

  • What: A general term for any Application Programming Interface.
  • Covers: Libraries, operating system APIs, or Web APIs.
  • Web API: An API that works over HTTP(S).
  • Everything below (REST, GraphQL, OData, SOAP) is a type of Web API.

2. Architectural style / query approach

These are design styles or paradigms for Web APIs.

StyleExample / Note
RESTResource-based, HTTP verbs (GET, POST). Very common.
GraphQLQuery language over HTTP. Clients specify exactly what data they want.
RPCRemote Procedure Call. You call a function over HTTP. JSON-RPC, XML-RPC. SOAP can be seen as a formalized XML-RPC.

3. Specifications / protocols

SpecBased onTypical Format
SOAPXML-based strict protocol (RPC style over HTTP)XML
ODataRESTful but with extra query semantics (filter, expand, etc)JSON / XML
GraphQLOwn query language specJSON

4. Actual web services (implementations)

  • The real HTTP endpoints that implement these standards.
  • e.g. /api/products, /graphql, /odata/Products, /soap/ProductService.svc

Visual hierarchy

API (broad concept)
├── Web API (over HTTP/S)
│   ├── REST (architectural style)
│   │   ├── OData (protocol that extends REST)
│   ├── GraphQL (query language spec over HTTP)
│   └── RPC
│       └── SOAP (protocol, uses XML, often RPC-style)
│
└── Non-HTTP APIs (SDKs, local libraries, etc)
graph TD
    API["API"]
    WebAPI["Web API"]
    REST["REST"]
    GraphQL["GraphQL"]
    RPC["RPC"]
    OData["OData"]
    SOAP["SOAP"]

    API --> WebAPI
    WebAPI --> REST
    WebAPI --> GraphQL
    WebAPI --> RPC
    REST --> OData
    RPC --> SOAP

Some clarifying notes

REST vs OData:

  • OData is basically REST + rules for querying (like $filter, $expand).
  • So OData is a RESTful implementation standard.

GraphQL vs REST:

  • GraphQL is a different approach: the client tells the server what shape of data it wants.

SOAP vs REST/OData/GraphQL:

  • SOAP is a protocol with strict XML messages, often WSDL files to describe operations.

Web service:

  • Means any machine-to-machine API over the web.
  • A SOAP service is a web service. A REST service is also a web service.
Share the Post:

Related Posts