Skip to content

Instantly share code, notes, and snippets.

@apsoto
Last active December 15, 2015 19:59
Show Gist options
  • Save apsoto/5315400 to your computer and use it in GitHub Desktop.
Save apsoto/5315400 to your computer and use it in GitHub Desktop.
backbone.siren actions examples
{
"class": [
"series"
],
"properties": {
},
"entities": [
{
"rel": [
"episodes"
],
"href": "http://api.wurl.dev/api/series/14/episodes",
"class": [
"collection"
]
}
],
"actions": [
{
"name": "follow-series",
"title": "Start following a series",
"method": "POST",
"type": "application/x-www-form-urlencoded",
"href": "http://api.wurl.dev/api/follows",
"fields": [
{
"name": "series_id",
"type": "text",
"value": 14
},
{
"name": "user_id",
"type": "text"
}
]
}
],
"links": [
{
"rel": [
"self"
],
"href": "http://api.wurl.dev/api/series/14"
}
]
}
{
"properties": {
"totalItems": 0,
"currentCount": 0
},
"actions": [
{
"name": "follow-series",
"title": "Start following a series",
"method": "POST",
"type": "application/x-www-form-urlencoded",
"href": "http://api.wurl.dev/api/users/1/follows",
"fields": [
{
"name": "series_id",
"type": "text"
}
]
}
],
"links": [
{
"rel": [
"self"
],
"href": "http://api.wurl.dev/api/users/1/follows"
},
{
"rel": [
"parent"
],
"href": "http://api.wurl.dev/api/users/1"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment