Skip to content

Instantly share code, notes, and snippets.

@kevinswiber
Last active August 29, 2015 14:06
Show Gist options
  • Select an option

  • Save kevinswiber/4a9258cfb9c80558c7ee to your computer and use it in GitHub Desktop.

Select an option

Save kevinswiber/4a9258cfb9c80558c7ee to your computer and use it in GitHub Desktop.
Siren example.
{
"class": ["customer", "vip"],
"properties": {
"name": "Howard Duck",
"title": "Mr."
},
"entities": [
{
"rel": ["http://example.com/rels/recent-orders"],
"class": ["order-list"],
"properties": {
"count": 5
},
"links": [
{
"rel": ["self"],
"href": "http://api.example.com/orders/recent?customer=1234"
}
]
}
],
"actions": [
{
"name": "deactivate",
"method": "POST",
"href": "http://api.example.com/customer-activations",
"fields": [
{ "name": "action", "type": "hidden", "value": "deactivate" },
{ "name": "id", "type": "hidden", "value": "1234" }
]
}
],
"links": [
{
"rel": ["self"],
"href": "http://api.example.com/customers/1234"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment