Media types & variants

Media types follow the general structure shown below:

application/vnd.xentral.VARIANT.vVERSION+DATAFORMAT

where:

  • VARIANT is a lowercase dash-separated identifier of a given representation
  • VERSION is its consecutive integer version number starting with 1. For more info on versioning see Versioning
  • DATAFORMAT is the structure of the data (for example: json, csv, xml, pdf, etc)

Calling for a non-existent Media Type will result in a 406 error.

📘

Media Types

Media types at Xentral are constructed according to IETF RFC 6838 Section 3.2

Variants

A variant describes the representation or the intent of the request.

Variant Example - GET request

The GET /products/[id] endpoint has three different media types it supports:

  • accept: application/vnd.xentral.default.v1+json
  • accept: application/vnd.xentral.minimal.v1+json
  • accept: application/vnd.xentral.default.v1+csv

Each of these Media Types represents different data formats of the Product Resource.