Files
api-guidelines/message/siren.md
apidesigner 7166c8826f Updates message/siren.md
Auto commit by GitBook Editor
2017-02-03 12:58:42 +00:00

996 B

Siren

Siren is a simple, JSON-based format for representing entities and hypermedia controls. It is capable of transferring a JSON representation of a resource, related resources, link relations and actions (HATEOAS controls).

Every Siren API response message SHOULD contain the properties field. If present, a representation of an entity MUST be under the properties field.

A Siren message SHOULD contain the class field to denot

Example

At minimum a response message might include some properties of resource it represents. In Siren, all the resource properties (data) are nested under the properties key.

A minimal Siren document that transfer some data looks like:

{
  "properties": {
    ...
  }
}

Let's say the example response should represent an "Order" resource:

{
  "properties": {
    "orderNumber": 42,
    "itemCount": 3,
    "status": "pending"
  }
}