Skip to content

Instantly share code, notes, and snippets.

@jazztpt
jazztpt / GETleaderboard.json
Created June 24, 2011 17:36
GET request returning calculated user data
{
"users_by_total_hits":
[
{
"name":"Betty Black",
"total_hits":"1205",
"num_articles":"23",
"num_blogs":"3"
},
{
@jazztpt
jazztpt / POSTarray_with_mapping.json
Created June 24, 2011 17:34
Return array of ids with a url mapping
{
"url_mapping":"http://oursocialbloggingsite.com/api/articles/<id>",
"elements":
[
{
"guid":"9876",
"id":"123"
}
]
}
@jazztpt
jazztpt / URLandID.json
Created June 24, 2011 17:31
Returning id and url to access the object
{
"id":"125",
"url-mapping":"http://oursocialbloggingsite.com/api/articles/{id}"
}
@jazztpt
jazztpt / URLreturn.json
Created June 24, 2011 17:29
Returning a url to access the object
{
"url":"http://oursocialbloggingsite.com/api/articles/125"
}
@jazztpt
jazztpt / GETleaderboard_simple.json
Created June 24, 2011 17:13
GET request returning calculated user data
{
"users_by_total_hits":
[
{
"name":"Betty Black",
"total_hits":"1205"
},
{
"name":"Abe Adams",
"total_hits":"835"
@jazztpt
jazztpt / POSTreturn_guid.json
Created June 24, 2011 17:02
POST return including original guid
[
{
"guid":"9876",
"url":"http://oursocialbloggingsite.com/api/articles/125"
}
]
@jazztpt
jazztpt / POSTarray.json
Created June 24, 2011 16:58
Accept arrays instead of single objects in POST requests
[
{
"title":"Exciting Blog Post",
"text":"To make an exciting post, talk about explosions. Works for Hollywood....",
"guid":"9876"
}
]
@jazztpt
jazztpt / GETfood_blog_hierarchy.json
Created June 24, 2011 16:45
GET request returning hierarchy of data
{
"title":"Food",
"articles":
[
{
"url":"http://oursocialbloggingsite.com/api/articles/111",
"title":"Why Food Is Delicious",
"author":"Abe Adams"
},
{
@jazztpt
jazztpt / GETfood_blog.json
Created June 24, 2011 16:36
GET the food blog (standard REST)
{
"title":"Food",
"articles":
[
"/articles/111",
"/articles/123"
]
}
@jazztpt
jazztpt / POSTarticle.json
Created June 24, 2011 16:12
example of a post request (REST)
POST http://oursocialbloggingsite.com/api/article
{
"title":"Exciting Blog Post",
"text":"To make an exciting post, talk about explosions. It works for Hollywood!"
}