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": {
"id": 14,
"description": "GUNS & EXPLOSIVES",
"channelsRank": 0,
"pubDate": "2013-03-20T17:13:07Z",
"title": "FPSRussia",
"thumbnails": {
"default": {
"url": "http://i2.ytimg.com/i/EPTp5WMAzjh9mOrKUwRLmQ/1.jpg?v=50dbe8c2"
}
},
"totalEpisodes": 1
},
"entities": [
{
"rel": [
"episodes"
],
"href": "http://api.wurl.dev/api/series/14/episodes",
"class": [
"collection"
]
}
],
"actions": [
{
"name": "follow-series",
"href": "http://api.wurl.dev/api/follows",
"title": "Start following a series",
"method": "POST",
"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