Skip to content

Instantly share code, notes, and snippets.

@darrelmiller
Created March 6, 2012 12:58
Show Gist options
  • Save darrelmiller/1986147 to your computer and use it in GitHub Desktop.
Save darrelmiller/1986147 to your computer and use it in GitHub Desktop.
Tekpub API
GET /
=>
200 OK
Content-Type: application/hal+json
{
"_links": {
"self": { "href": "/" },
"urn:tekpub:login": { "href": "/login" }
}
}
GET /login
=>
200 OK
Content-Type: application/hal+json
{"_links": {
"self": { "href" : "/Login"},
"urn:tekpub:userhome" : { "href" : "/user/95/home"}
},
"Message" : "Welcome Joe"
}
GET /user/95/home
=>
200 OK
Content-Type: application/hal+json
{ "_links": {
"self" : { "href" :"/user/95/home" },
"urn:tekpub:allproductions" : { "href" : "/user/95/allproductions", "title" : "All productions" },
"urn:tekpub:newepisodes" : { "href" : "/episodes/new", "title" : "New Episodes" },
"urn:tekpub:productionsbycategory" : { "href" : "/productions{?category}" }
"urn:tekpub:categories" : { "href" : "/categories" }
}
}
GET /user/95/allproductions
=>
200 OK
Content-Type: application/hal+json
{
"_links" : {
"self" : { "href" : "/user/95/allproductions" },
},
"name" : "Joe",
"_embedded" : {
"urn:tekpub:production" : [
{ "_links": {
"self": { "href": "/production/22" },
},
"allowed" : "true",
"title" : "Rails runs rings round ReST resource representations"
},
{ "_links": {
"self": { "href": "/production/74" },
},
"allowed" : "false",
"title" : "Surfing the waves beats surfing an API"
}
]
}
}
GET /production/22
=>
200 OK
Content-Type: application/hal+json
{
"_links" : {
"self" : { "href" : "/production/22" },
},
"title" : "Rails runs rings round ReST resource representations",
"_embedded" : {
"urn:tekpub:episode" : [
{ "_links": {
"self": { "href": "/episode/745" },
"urn:tekpub:content" : { "href" : "/content/745.mp4" }
},
"title" : "PATCH or PUT that is the question",
},
{ "_links": {
"self": { "href": "/episode/921" },
"urn:tekpub:content" : { "href" : "/content/921.mp4" }
},
"title" : "RESTful URL - The mythical creature"
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment