Hypermedia / HATEOAS

Hypermedia are links attached to the response-data which describes related navigational routes related to the given returned object.

Our implementation is based on HAL (http://stateless.co/hal_specification.html)

Metadata in json result are prefixed with “_” to clearly seperate from database mapped fields.

“_links” contains all links.

How to activate?

To receive hypermedia you need to add the ?hateoas=true in the request URL.

Example:

{
  "_links": {
        "actions": {
            "new-based-on": {
                "href": "biz/orders/1?action=new-based-on",
                "method": "POST",
                "responsetype": "object",
                "title": "New order based on current"
            },
            "next": {
                "href": "biz/orders/1?action=next",
                "method": "POST",
                "responsetype": "object",
                "title": "Get next order"
            },
            "previous": {
                "href": "biz/orders/1?action=previous",
                "method": "POST",
                "responsetype": "object",
                "title": "Get previous order"
            }
        },
        "relations": {
            "lines": {
                "href": "biz/orderlines?filter=orderid eq 1",
                "method": "GET",
                "responsetype": "array",
                "title": "self"
            },
            "self": {
                "href": "biz/orders/1",
                "method": "GET",
                "responsetype": "object",
                "title": "self"
            }
        },
        "transitions": {
            "cancel": {
                "href": "biz/orders/1?action=cancel",
                "method": "POST",
                "responsetype": "void",
                "title": "Cancel"
            },
            "transfer-to-invoice": {
                "href": "biz/orders/1?action=transfer-to-invoice",
                "method": "POST",
                "responsetype": "void",
                "title": "Transfer to invoice"
            },
            "transfer-to-quote": {
                "href": "biz/orders/1?action=transfer-to-quote",
                "method": "POST",
                "responsetype": "void",
                "title": "Transfer to quote"
            }
        }
    },
    "Attachments": null,
    "Comment": null,
    "CreatedBy": null,
    "CreatedDate": null,
    "CurrencyCode": null,
    "CustomValues": {},
    "CustomerID": 1,
    "CustomerOrgNumber": null,
    "CustomerPerson": null,
    "Deleted": false,
    "DeliveryDate": null,
    "DeliveryMethod": null,
    "DeliveryTerm": null,
    "DimensionsID": 1,
    "FreeTxt": "Free",
    "ID": 1
}