ABCDEFGHIJKLMNOPQRSTU
1
StatusURLDescriptionSample InputSample ResponseExample Query
2
DELETE /lattice/admin/debug/wipeDeletes all data in the database (affects all users). Only works in debug mode.curl -v -X DELETE 'http://localhost:4322/lattice/admin/debug/wipe'
3
POST /lattice/:username/stack/search

POST DATA:
{
search_url : String,
search_terms : String,
search_provider: String
place_url : String,
place_title: String
}
Creates a new stack/browsing session. [:place_url] parameter is the link the user clicks from the search result page.

The API expects a [:search_provider] parameter, which is either "bing" or "twitter"

Returns a [:stack_id], [:stack_title], [:session_id], [:thumb_job_id], [:search_place_id] and a [:place_id]
{"search_url": "http://bing.com", "search_terms": "narwhals are awesome", "place_url": "http://narwhalsrus.com", "place_title" : "Beautiful Narwhals"}{"place": {"url": "http://narwhalsrus.com", "title": "Beautiful Narwhals", "id": "b0f6d9c35b26437cadecea57a5280676", "thumbnail_key": "da05316bd3ee361b4c703bfdd0f022695c06fcceaef4301b89847e47"}, "search_place": {"id": "116d3c053c844e3bb19c40a222e310ab", "thumbnail_key": "3193e3654d252acb5953383e56234492892decb37964dcd9d2a5be7a"}, "stack": {"id": "6471e64376a24d7cb1d0c4fd9bc26675", "title": "narwhals are awesome"}, "session_id": "2a9b5f38d9b8496e8869ad4573ea0f03", "thumbnails_job": "7675494b-5719-4621-8d27-99a2ec23d0fa"}curl -v -d '{"search_url": "http://bing.com", "search_terms": "narwhals are awesome", "place_url": "http://narwhalsrus.com", "place_title" : "Beautiful Narwhals"}' -X POST 'http://localhost:4322/lattice/oyiptong@mozilla.com/stack/search'
4
POST /lattice/:username/stack/direct

POST DATA:
{
url : String,
title: String
}
Creates a new stack from a direct url entry or resumes a session into an existing one.
Direct URL stacks are unique per user, based on the url entered.
{"url" :
"http://www.marketwatch.com/story/facebook-starts-at-40-in-debut-then-fizzles-2012-05-18?dist=afterbell",
"title" : "Facebook IPO loses steam at the end - IPO Report -
MarketWatch"}

{"session_id": "f6d87ac9c3b446818db7fdda75010a8b","place" {"id": "bd45e53204eb43299601b926570613aa","thumbnail_key" :"d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f"},"stack" : {"id": "f6d87ac9c3b446818db7fdda75010a8b","title" : "Facebook IPO loses steam at the end - IPO Report - MarketWatch","subtype" : "direct","provider" : "direct"},"thumbnails_job" : "f7c3c86e-8ff6-4d5a-ad2b-5991ed771784"}
curl -v -d {"url" :
"http://www.marketwatch.com/story/facebook-starts-at-40-in-debut-then-fizzles-2012-05-18?dist=afterbell",
"title" : "Facebook IPO loses steam at the end - IPO Report -
MarketWatch"}' -X POST
'http://localhost:4322/lattice/oyiptong@mozilla.com/stack/direct'
5
PUT /lattice/:username/stack/link

POST DATA:
{
stack_id : String,
session_id : String,
place_url: String,
place_title : String
}
Appends a hard link entry to a stack. Sets active page for the session to be [:url]

Returns a [:place_id], [:thumbnails_job] and [:thumbnail_key] for the given [:url]
{"stack_id": "f6d87ac9c3b446818db7fdda75010a8b", "session_id": "f6d87ac9c3b446818db7fdda75010a8b", "place_url": "http://tastybacon.com", "place_title": "Bacons are delicious!"}{"place_id": "bd45e53204eb43299601b926570613aa", "thumbnail_key": "bd45e53204eb43299601b926570613aa", "thumbnails_job" : "f7c3c86e-8ff6-4d5a-ad2b-5991ed771784"}curl -v -d '{"stack_id": "f6d87ac9c3b446818db7fdda75010a8b", "session_id": "f6d87ac9c3b446818db7fdda75010a8b", "dest": {"url": "http://tastybacon.com", "title": "Bacons are delicious!"}}' -X PUT 'http://localhost:4322/lattice/oyiptong@mozilla.com/stack/link'
6
PUT /lattice/:username/stack/warp

POST DATA:
{
stack_id : String,
session_id: String,
place_id : String
}
Warp to an existing "place" in the "stack".
This will be called when a user uses the "filmstrip" feature to go back or forward in their browsing session.

Sets active page for the session to be [:place_id]
{"stack_id": "f6d87ac9c3b446818db7fdda75010a8b", "session_id": "f6d87ac9c3b446818db7fdda75010a8b", "place_id": "bd45e53204eb43299601b926570613aa"}curl -v -d '{"stack_id": "f6d87ac9c3b446818db7fdda75010a8b", "session_id": "f6d87ac9c3b446818db7fdda75010a8b", "place_id": "f6d87ac9c3b446818db7fdda75010a8b"}' -X PUT 'http://localhost:4322/lattice/oyiptong@mozilla.com/stack/warp'
7
GET /lattice/:username/session/active

QUERY PARAMS:
l: Integer (Optional) (Default: 20)
Obtains all stacks that have an active session, with the active page details, ordered by latest-access-time, and the [:thumbnails_job]. Furthermore, each stack returns a [:page_count], which is the number of pages in a stack and a [:stack_title] which for stacks started by search is search terms used.

The number of results returned can be limited by specifying the 'l' query parameter, which takes an integer
{"d": [{"stack": {"page_count": 2, "id": "e50b8de9327742f194a196b0c32b404c", "title": "the time"}, "session_id": "5db1fc836e7d4fdbb79da5510562b4a6", "page": {"url": "http://bing.com/search?q=the+time", "thumbnail_key": "1e693510d6bca5da57937699081e2ceca956df68cfb3d4bb107fb2e0", "id": "837cca7b29f14ffba6dc7295ee46c0e6", "title": "Bing"}}, {"stack": {"page_count": 2, "id": "ae9279f104164422b34fae0ebb2da544", "title": "the time"}, "session_id": "b1e499b8fcb54ca0a15e9e5b731a9ecd", "page": {"url": "http://bing.com/search?q=the+time", "thumbnail_key": "1e693510d6bca5da57937699081e2ceca956df68cfb3d4bb107fb2e0", "id": "f5c46b51ec6647e09d1e6cb1f18fd51d", "title": "Bing"}}, {"stack": {"page_count": 5, "id": "fc29a20f2e2d41399fe9c66755f49952", "title": "sweet potato fries"}, "session_id": "0b209ac2720f424296a2d00e5d851ae8", "page": {"url": "http://bing.com/search?q=sweet+potato+fries", "thumbnail_key": "a611d186f4028c835dcfa1e3b8f7565551ad35f2f74d252b4dd8d61a", "id": "0f8b9befad0c4a87ad94832da93d3ec4", "title": "Bing"}}, {"stack": {"page_count": 7, "id": "442638ae15d3491cbae2253629abbb58", "title": "sweet potato fries"}, "session_id": "6e536b8d720f4f41a12b154196ff506d", "page": {"url": "http://www.foodnetwork.com/recipes/paula-deen/baked-sweet-potato-fries-recipe/index.html", "thumbnail_key": "5ea1b30da5b6ae6e3d5de5de9618250df0fe3d5d376b631f66a295f5", "id": "a29d154b4e27436fb9c2a6c97ede479d", "title": "Baked Sweet Potato Fries Recipe : Paula Deen : Food Network"}}, {"stack": {"page_count": 5, "id": "4ae389ce273a47e5bc1b2d2c51198d08", "title": "polenta"}, "session_id": "c02c1bbf8b7946deaaec5ff4ffaaa68b", "page": {"url": "http://italianfood.about.com/od/primivari/r/blr0687.htm", "thumbnail_key": "3571d3b963680e88379e306d2701cbe65630f684689d7c84593b3d6d", "id": "facc0891e0c0430a87c9938692bd4592", "title": "Panissa Ligure Recipe - Frugal Ligurian Chickpea Puree - A Ligurian Chickpea Farinata"}}, {"stack": {"page_count": 6, "id": "5180dbbe64dd48f4b8f726c6c5f65a37", "title": "elephant"}, "session_id": "3bc48854a8af49319acec7341e3ea657", "page": {"url": "http://en.wikipedia.org/wiki/Elephant_intelligence", "thumbnail_key": "2286d6fb7d9815a43b75254afbe8fe2f079f240acef8c08ef927fd93", "id": "5096ce4ca5404402a36004b5919653be", "title": "Elephant cognition - Wikipedia, the free encyclopedia"}}, {"stack": {"page_count": 15, "id": "a75629abec2f4a5c9fa34c955d4a8bae", "title": "social"}, "session_id": "c83ee0c1603b43d49826e20312dee184", "page": {"url": "http://en.wikipedia.org/wiki/Human_rights_in_the_People%27s_Republic_of_China", "thumbnail_key": "b1cbfd5929044a04eee0702a131e2dbd83a3a8db787ac73d0c0e200f", "id": "d7fb2d074eae4529bd00ad076d05dd7e", "title": "Human rights in the People's Republic of China - Wikipedia, the free encyclopedia"}}, {"stack": {"page_count": 2, "id": "d097121819184fca811ce5d5c1f2016d", "title": "social"}, "session_id": "d448563bc1a24a6b80dad8eee669e782", "page": {"url": "http://en.wikipedia.org/wiki/Social", "thumbnail_key": "2da46db5dd5b67dedfceeb16221b5443e6e9c46b27cd5af89d432e27", "id": "e929d4b722724b6d8d9ce9635f09367b", "title": "Social - Wikipedia, the free encyclopedia"}}, {"stack": {"page_count": 2, "id": "afd24d34bd7a4378825db7006cf77edd", "title": "special"}, "session_id": "f96c6db61adf43729e469fd92bb54523", "page": {"url": "http://www.thefreedictionary.com/special", "thumbnail_key": "82c0057ae24c7034df38e481d0defa2b01d871a6ea72d179d5ed01e9", "id": "d145d94471664fb8912332437b3a9955", "title": "special - definition of special by the Free Online Dictionary ..."}}, {"stack": {"page_count": 2, "id": "41ff044a5a5c40cfaa7b2bf9dd544496", "title": "hockey"}, "session_id": "85ed3831e6e44e41b648442ccc36952f", "page": {"url": "http://en.wikipedia.org/wiki/Hockey", "thumbnail_key": "c9924006921f6dcc6d9a759052358e62f80e35265558b0ccbdb440a6", "id": "b17079cdf30b42e3a8a90c75766a618f", "title": "Hockey - Wikipedia, the free encyclopedia"}}, {"stack": {"page_count": 2, "id": "181aedc891f047feb5758d9777ac28a7", "title": "assail"}, "session_id": "f88cf6b6d28a4a6b9dd449a283d90380", "page": {"url": "http://dictionary.reference.com/browse/assail", "thumbnail_key": "1d1d7a86589c90b4645d93d716bd2f036a14e808a62ee9f80199880d", "id": "b970e75b39d6436a921adfdd7ba6564f", "title": "Assail | Define Assail at Dictionary.com"}}, {"stack": {"page_count": 2, "id": "db5e922d89dd4e1892736e0e085e8b43", "title": "superman"}, "session_id": "e8fb0a60411449988a1e96e7a58bbbe7", "page": {"url": "http://en.wikipedia.org/wiki/Superman_(film)", "thumbnail_key": "08b7fba1287fa4b5df6ef15790b8c27922a062dc1e7836488928328d", "id": "fb7db29f47194bbca2444b74987e8168", "title": "Superman (film) - Wikipedia, the free encyclopedia"}}, {"stack": {"page_count": 2, "id": "24ddd334093c4ecc9d36b134fcfdbeb6", "title": "superman"}, "session_id": "bb539b29d7c6400e96f53ff5a205802c", "page": {"url": "http://en.wikipedia.org/wiki/Superman", "thumbnail_key": "7670048affc68c45de0cc97ee1657d88fea35ec085e3ffe5c856cc4e", "id": "23f743174b9b4091838ccee4af9acd18", "title": "Superman - Wikipedia, the free encyclopedia"}}, {"stack": {"page_count": 4, "id": "726076be06a64798a7b3a0f2e13337d6", "title": null}, "session_id": "30c1a8a8c7734f2188c70df049aadb45", "page": {"url": "http://narwhalsrus.com", "thumbnail_key": "da05316bd3ee361b4c703bfdd0f022695c06fcceaef4301b89847e47", "id": "785e7a273d034ff0a4a719bfeb30ba45", "title": "Beautiful Narwhals"}}], "thumbnails_job": "3c335e97-eb42-41fb-8562-bd420f83fba1"}curl -v 'http://localhost:4322/oyiptong@mozilla.com/session/active'
8
GET /lattice/:username/stack/:stack_id/nodesReturns all places in a given stack, as a list of places, ordered by last-created time, with a [:thumbnails_job]{"d" : [{"thumbnail_key": "da05316bd3ee361b4c703bfdd0f022695c06fcceaef4301b89847e47", "url": "http://narwhalsrus.com", "created": 1326315175859, "id": "813eef01aa5347dabb82e4970ff1f6d5", "title": "Beautiful Narwhals"}, {"thumbnail_key": "19f17c273ef99966cfa7dd7b0208e171a8458fa9cc280f400ea0d9b2", "url": "http://bing.com/search", "created": 1326315175859, "id": "3e834114362a410abb567b6c48f1b7fd", "title": "Bing"}, {"thumbnail_key": "0acb2649145f946baadeb6a81139afaa1a658d0ef5dd491a3566c43b", "url": "http://tastybacon.com", "created": 1326315176953, "id": "5077a9dbd4c341948de7b3e8f7915502", "title": "Bacon Sure is Tasty"}, {"thumbnail_key": "5422bad7b42b5a8c06b1505e4b5ed3f2080c5f532974680721c0df1a", "url": "http://unicorns.com", "created": 1326315178732, "id": "c2dce26253714ad790695a4e3f0d738e", "title": "Mighty Unicorns"}], "thumbnails_job" : "f7c3c86e-8ff6-4d5a-ad2b-5991ed771784"}curl -v 'http://localhost:4322/lattice/oyiptong@mozilla.com/stack/f5d67f1ff0c646f9833965b3ab706618/nodes'
9
GET /lattice/:username/stack/:stack_id/activeReturns the active session and active page in a given stack, if and only if that stack has an active session. The output is the same that comes out of session/active, except only for one stack.{"place": {"url": "about:blank", "thumbnail_key": "3c4fd307aff9b74700d3eece2a7b89942cd95cfb", "id": "89b02f210cf241b1830110bd8156f2ac", "title": ""}, "stack": {"page_count": 3, "id": "fb1695bca4134547ad6960befa5ed0f2", "title": "Wells Fargo Bank"}, "session_id": "b283817ab1d6475f8f053fbf71a096cf", "thumbnails_job": null}curl -v 'http://localhost:4322/lattice/oyiptong@mozilla.com/stack/f5d67f1ff0c646f9833965b3ab706618/active'
10
DELETE /lattice/:username/wipeDeletes all data for a user, keeps the user node in our global graphcurl -v -X DELETE 'http://localhost:4322/lattice/oyiptong@mozilla.com/wipe'
11
POST /lattice/:username/createCreates a user node for the given usernamecurl -v -X POST 'http://localhost:4322/lattice/oyiptong@mozilla.com/create'
12
GET /lattice/:username/graphObtains a graph in json format{"active_sessions": [{"start": "b5916b688ee843758367f5642d8e563a", "end": "6c9767484c294f2ebaee7653611f830d", "data": {"type": "active_session"}}], "user": {"username": "oyiptong@mozilla.com", "user_id": "b5916b688ee843758367f5642d8e563a"}, "stacks": [{"relationships": [{"start": "3a658b7d3b4a47b893323160930064ff", "end": "6c9767484c294f2ebaee7653611f830d", "data": {"created": 1330105949294}, "type": "session"}, {"start": "6c9767484c294f2ebaee7653611f830d", "end": "2ae439c6d9804199b22d73bd4cff9182", "data": {"url": "http://bing.com", "terms": "the most simple stack", "session_id": "6c9767484c294f2ebaee7653611f830d", "created": 1330108878766}, "type": "search"}, {"start": "6c9767484c294f2ebaee7653611f830d", "end": "8bbf8e01726341fcabbd3a3dc411d2e6", "data": {"created": 1330105949294}, "type": "active_page"}, {"start": "2ae439c6d9804199b22d73bd4cff9182", "end": "8bbf8e01726341fcabbd3a3dc411d2e6", "data": {"type": "hard", "session_id": "6c9767484c294f2ebaee7653611f830d", "created": 1330108878765}, "type": "link"}], "nodes": [{"stack_id": "3a658b7d3b4a47b893323160930064ff", "type": "session", "uuid": "6c9767484c294f2ebaee7653611f830d", "created": 1330108878669}, {"uuid": "2ae439c6d9804199b22d73bd4cff9182", "title": "", "url": "http://bing.com", "created": 1330108878671, "subtype": "search", "type": "place"}, {"uuid": "8bbf8e01726341fcabbd3a3dc411d2e6", "title": "The world"s simplest stack", "url": "http://simplestack.com", "created": 1330108878678, "subtype": "", "type": "place"}], "stack": {"title": "the most simple stack", "type": "stack", "uuid": "3a658b7d3b4a47b893323160930064ff", "created": 1330108878668}}]}curl -v 'http://localhost:4322/lattice/oyiptong@mozilla.com/graph'
13
POST /lattice/:username/graph/import

POST DATA: data format given by /lattice/:username/graph export function
Creates stacks for a user given{"active_sessions": [{"start": "b5916b688ee843758367f5642d8e563a", "end": "6c9767484c294f2ebaee7653611f830d", "data": {"type": "active_session"}}], "user": {"username": "oyiptong@mozilla.com", "user_id": "b5916b688ee843758367f5642d8e563a"}, "stacks": [{"relationships": [{"start": "3a658b7d3b4a47b893323160930064ff", "end": "6c9767484c294f2ebaee7653611f830d", "data": {"created": 1330105949294}, "type": "session"}, {"start": "6c9767484c294f2ebaee7653611f830d", "end": "2ae439c6d9804199b22d73bd4cff9182", "data": {"url": "http://bing.com", "terms": "the most simple stack", "session_id": "6c9767484c294f2ebaee7653611f830d", "created": 1330108878766}, "type": "search"}, {"start": "6c9767484c294f2ebaee7653611f830d", "end": "8bbf8e01726341fcabbd3a3dc411d2e6", "data": {"created": 1330105949294}, "type": "active_page"}, {"start": "2ae439c6d9804199b22d73bd4cff9182", "end": "8bbf8e01726341fcabbd3a3dc411d2e6", "data": {"type": "hard", "session_id": "6c9767484c294f2ebaee7653611f830d", "created": 1330108878765}, "type": "link"}], "nodes": [{"stack_id": "3a658b7d3b4a47b893323160930064ff", "type": "session", "uuid": "6c9767484c294f2ebaee7653611f830d", "created": 1330108878669}, {"uuid": "2ae439c6d9804199b22d73bd4cff9182", "title": "", "url": "http://bing.com", "created": 1330108878671, "subtype": "search", "type": "place"}, {"uuid": "8bbf8e01726341fcabbd3a3dc411d2e6", "title": "The world"s simplest stack", "url": "http://simplestack.com", "created": 1330108878678, "subtype": "", "type": "place"}], "stack": {"title": "the most simple stack", "type": "stack", "uuid": "3a658b7d3b4a47b893323160930064ff", "created": 1330108878668}}]}curl -v -d '{"active_sessions": [{"start": "b5916b688ee843758367f5642d8e563a", "end": "6c9767484c294f2ebaee7653611f830d", "data": {"type": "active_session"}}], "user": {"username": "oyiptong@mozilla.com", "user_id": "b5916b688ee843758367f5642d8e563a"}, "stacks": [{"relationships": [{"start": "3a658b7d3b4a47b893323160930064ff", "end": "6c9767484c294f2ebaee7653611f830d", "data": {"created": 1330105949294}, "type": "session"}, {"start": "6c9767484c294f2ebaee7653611f830d", "end": "2ae439c6d9804199b22d73bd4cff9182", "data": {"url": "http://bing.com", "terms": "the most simple stack", "session_id": "6c9767484c294f2ebaee7653611f830d", "created": 1330108878766}, "type": "search"}, {"start": "6c9767484c294f2ebaee7653611f830d", "end": "8bbf8e01726341fcabbd3a3dc411d2e6", "data": {"created": 1330105949294}, "type": "active_page"}, {"start": "2ae439c6d9804199b22d73bd4cff9182", "end": "8bbf8e01726341fcabbd3a3dc411d2e6", "data": {"type": "hard", "session_id": "6c9767484c294f2ebaee7653611f830d", "created": 1330108878765}, "type": "link"}], "nodes": [{"stack_id": "3a658b7d3b4a47b893323160930064ff", "type": "session", "uuid": "6c9767484c294f2ebaee7653611f830d", "created": 1330108878669}, {"uuid": "2ae439c6d9804199b22d73bd4cff9182", "title": "", "url": "http://bing.com", "created": 1330108878671, "subtype": "search", "type": "place"}, {"uuid": "8bbf8e01726341fcabbd3a3dc411d2e6", "title": "The world"s simplest stack", "url": "http://simplestack.com", "created": 1330108878678, "subtype": "", "type": "place"}], "stack": {"title": "the most simple stack", "type": "stack", "uuid": "3a658b7d3b4a47b893323160930064ff", "created": 1330108878668}}]}' 'http://localhost:4322/lattice/oyiptong@mozilla.com/graph/import'
14
GET /lattice/:username/stack/:stack_id/vis.[:format]Visualizes objects in a stack. Choices of formats are: png, svg and html. Debug only.curl -v http://localhost:4322/lattice/oyiptong@mozilla.com/stack/04e8e3e7730e41afbc431c579dbdf7d7/vis.html
15
GET /lattice/:username/stack/:stack_id/extra.vis.[:format]Visualizes objects in a stack, with timeline display. Choices of formats are: png, svg and html. Debug only.curl -v http://localhost:4322/lattice/oyiptong@mozilla.com/stack/04e8e3e7730e41afbc431c579dbdf7d7/extra.vis.html
16
GET /lattice/:username/stack/:stack_id/timeline/vis.[:format]Visualizes timeline display for the stack. Choices of formats are: png, svg and html. Debug only.curl -v http://localhost:4322/lattice/oyiptong@mozilla.com/stack/04e8e3e7730e41afbc431c579dbdf7d7/timeline/vis.html
17
GET /lattice/:username/graph/vis.[:format]Visualizes objects in a graph. Choices of formats are: png, svg and html. Debug only.curl -v http://localhost:4322/lattice/oyiptong@mozilla.com/graph/vis.html
18
POST /lattice/:username/session/active/:session_id/closeCloses a sessioncurl -X POST 'http://localhost:4322/lattice/oyiptong@mozilla.com/session/active/0712ffd112db4398bdd849166824673c/close'
19
DELETE /lattice/:username/stack/Deletes a stack. Its a debug-only featurecurl -v -X DELETE 'http://localhost:4322/lattice/oyiptong@mozilla.com/stack/f15e65672f4c43efacdcb5572fb55253'
20
GET /lattice/:username/stack/:stack_id/export.jsonSerialize a stack to JSON format{"relationships": [{"start": "24f76e41ed214b69b95c75d18984828f", "end": "55956105695d4682b5ccebbef498de9c", "data": {"created": 1328299150573}, "type": "session"}, {"start": "55956105695d4682b5ccebbef498de9c", "end": "8f6e9690ca3b40eda60bbd9859d12908", "data": {"url": "http://bing.com", "terms": "sweet potato fries", "session_id": "55956105695d4682b5ccebbef498de9c", "created": 1328301915031}, "type": "search"}, {"start": "55956105695d4682b5ccebbef498de9c", "end": "9f67ac549a994b6183c0a63db8a5ea3b", "data": {"created": 1328299150573}, "type": "active_page"}, {"start": "8f6e9690ca3b40eda60bbd9859d12908", "end": "aa3d63f4ff974eb3aa330d1901bbb545", "data": {"type": "hard", "session_id": "55956105695d4682b5ccebbef498de9c", "created": 1328301915031}, "type": "link"}, {"start": "9f67ac549a994b6183c0a63db8a5ea3b", "end": "8eed3b1118a04602b2675ba783f86091", "data": {"type": "warp", "session_id": "55956105695d4682b5ccebbef498de9c", "created": 1328302402144}, "type": "link"}, {"start": "aa3d63f4ff974eb3aa330d1901bbb545", "end": "9f67ac549a994b6183c0a63db8a5ea3b", "data": {"type": "hard", "session_id": "55956105695d4682b5ccebbef498de9c", "created": 1328302090664}, "type": "link"}, {"start": "aa3d63f4ff974eb3aa330d1901bbb545", "end": "1265abfdf903441c82351743530839ac", "data": {"type": "hard", "session_id": "55956105695d4682b5ccebbef498de9c", "created": 1328301928685}, "type": "link"}, {"start": "8eed3b1118a04602b2675ba783f86091", "end": "9f67ac549a994b6183c0a63db8a5ea3b", "data": {"type": "warp", "session_id": "55956105695d4682b5ccebbef498de9c", "created": 1328302410160}, "type": "link"}, {"start": "8eed3b1118a04602b2675ba783f86091", "end": "1265abfdf903441c82351743530839ac", "data": {"type": "warp", "session_id": "55956105695d4682b5ccebbef498de9c", "created": 1328301948921}, "type": "link"}, {"start": "1265abfdf903441c82351743530839ac", "end": "77a370d6dca24299ac78b54e4e5c4ee2", "data": {"type": "hard", "session_id": "55956105695d4682b5ccebbef498de9c", "created": 1328301965767}, "type": "link"}, {"start": "1265abfdf903441c82351743530839ac", "end": "8eed3b1118a04602b2675ba783f86091", "data": {"type": "hard", "session_id": "55956105695d4682b5ccebbef498de9c", "created": 1328301944242}, "type": "link"}, {"start": "77a370d6dca24299ac78b54e4e5c4ee2", "end": "29063d867eb3432e828b9180c30f657f", "data": {"type": "hard", "session_id": "55956105695d4682b5ccebbef498de9c", "created": 1328301973860}, "type": "link"}, {"start": "29063d867eb3432e828b9180c30f657f", "end": "aa3d63f4ff974eb3aa330d1901bbb545", "data": {"type": "warp", "session_id": "55956105695d4682b5ccebbef498de9c", "created": 1328302076750}, "type": "link"}], "nodes": [{"stack_id": "24f76e41ed214b69b95c75d18984828f", "type": "session", "uuid": "55956105695d4682b5ccebbef498de9c", "created": 1328301914759}, {"url": "http://bing.com/search?q=sweet+potato+fries", "title": "Bing", "type": "place", "uuid": "8f6e9690ca3b40eda60bbd9859d12908", "created": 1328301914760}, {"url": "http://www.foodnetwork.com/search/Sweet+Potato+Fries/results.do?fnSearchType=recipe", "title": "Sweet Potato Fries : Food Network", "type": "place", "uuid": "aa3d63f4ff974eb3aa330d1901bbb545", "created": 1328301914760}, {"url": "http://www.foodnetwork.com/recipes/paula-deen/baked-sweet-potato-fries-recipe/index.html", "title": "Baked Sweet Potato Fries Recipe : Paula Deen : Food Network", "type": "place", "uuid": "9f67ac549a994b6183c0a63db8a5ea3b", "created": 1328302090420}, {"url": "http://www.foodnetwork.com/recipe-collections/sweet-potato/index.html", "title": "Sweet Potato Recipes", "type": "place", "uuid": "1265abfdf903441c82351743530839ac", "created": 1328301928426}, {"url": "http://www.foodnetwork.com/recipes/neelys/twice-baked-sweet-potatoes-recipe/index.html", "title": "Twice Baked Sweet Potatoes Recipe : Patrick and Gina Neely : Food Network", "type": "place", "uuid": "8eed3b1118a04602b2675ba783f86091", "created": 1328301944010}, {"url": "http://www.foodnetwork.com/recipes/stuffed-sweet-potato-bites-recipe/index.html", "title": "Stuffed Sweet Potato Bites Recipe : : Food Network", "type": "place", "uuid": "77a370d6dca24299ac78b54e4e5c4ee2", "created": 1328301965509}, {"url": "http://www.foodnetwork.com/recipe-collections/comfort-food/index.html", "title": "No title available", "type": "place", "uuid": "29063d867eb3432e828b9180c30f657f", "created": 1328301973651}], "stack": {"type": "stack", "uuid": "24f76e41ed214b69b95c75d18984828f", "created": 1328301914757}}curl -v -X GET http://localhost:4322/lattice/oyiptong@mozilla.com/stack/fd6b5cd6ec294011a4563c0036d3f412/export.json
21
POST /lattice/:username/stack/import

POST DATA: whatever /lattice/:username/stack/:stack_id/export.json returns
Import a stack or a list of stacks in JSON format. This will add the given stacks to the user's graph.
The input can either be one stack as a JSON object, or an array of JSON objects. The objects can be obtained via the export API function
{"relationships": [{"start": "24f76e41ed214b69b95c75d18984828f", "end": "55956105695d4682b5ccebbef498de9c", "data": {"created": 1328299150573}, "type": "session"}, {"start": "55956105695d4682b5ccebbef498de9c", "end": "8f6e9690ca3b40eda60bbd9859d12908", "data": {"url": "http://bing.com", "terms": "sweet potato fries", "session_id": "55956105695d4682b5ccebbef498de9c", "created": 1328301915031}, "type": "search"}, {"start": "55956105695d4682b5ccebbef498de9c", "end": "9f67ac549a994b6183c0a63db8a5ea3b", "data": {"created": 1328299150573}, "type": "active_page"}, {"start": "8f6e9690ca3b40eda60bbd9859d12908", "end": "aa3d63f4ff974eb3aa330d1901bbb545", "data": {"type": "hard", "session_id": "55956105695d4682b5ccebbef498de9c", "created": 1328301915031}, "type": "link"}, {"start": "9f67ac549a994b6183c0a63db8a5ea3b", "end": "8eed3b1118a04602b2675ba783f86091", "data": {"type": "warp", "session_id": "55956105695d4682b5ccebbef498de9c", "created": 1328302402144}, "type": "link"}, {"start": "aa3d63f4ff974eb3aa330d1901bbb545", "end": "9f67ac549a994b6183c0a63db8a5ea3b", "data": {"type": "hard", "session_id": "55956105695d4682b5ccebbef498de9c", "created": 1328302090664}, "type": "link"}, {"start": "aa3d63f4ff974eb3aa330d1901bbb545", "end": "1265abfdf903441c82351743530839ac", "data": {"type": "hard", "session_id": "55956105695d4682b5ccebbef498de9c", "created": 1328301928685}, "type": "link"}, {"start": "8eed3b1118a04602b2675ba783f86091", "end": "9f67ac549a994b6183c0a63db8a5ea3b", "data": {"type": "warp", "session_id": "55956105695d4682b5ccebbef498de9c", "created": 1328302410160}, "type": "link"}, {"start": "8eed3b1118a04602b2675ba783f86091", "end": "1265abfdf903441c82351743530839ac", "data": {"type": "warp", "session_id": "55956105695d4682b5ccebbef498de9c", "created": 1328301948921}, "type": "link"}, {"start": "1265abfdf903441c82351743530839ac", "end": "77a370d6dca24299ac78b54e4e5c4ee2", "data": {"type": "hard", "session_id": "55956105695d4682b5ccebbef498de9c", "created": 1328301965767}, "type": "link"}, {"start": "1265abfdf903441c82351743530839ac", "end": "8eed3b1118a04602b2675ba783f86091", "data": {"type": "hard", "session_id": "55956105695d4682b5ccebbef498de9c", "created": 1328301944242}, "type": "link"}, {"start": "77a370d6dca24299ac78b54e4e5c4ee2", "end": "29063d867eb3432e828b9180c30f657f", "data": {"type": "hard", "session_id": "55956105695d4682b5ccebbef498de9c", "created": 1328301973860}, "type": "link"}, {"start": "29063d867eb3432e828b9180c30f657f", "end": "aa3d63f4ff974eb3aa330d1901bbb545", "data": {"type": "warp", "session_id": "55956105695d4682b5ccebbef498de9c", "created": 1328302076750}, "type": "link"}], "nodes": [{"stack_id": "24f76e41ed214b69b95c75d18984828f", "type": "session", "uuid": "55956105695d4682b5ccebbef498de9c", "created": 1328301914759}, {"url": "http://bing.com/search?q=sweet+potato+fries", "title": "Bing", "type": "place", "uuid": "8f6e9690ca3b40eda60bbd9859d12908", "created": 1328301914760}, {"url": "http://www.foodnetwork.com/search/Sweet+Potato+Fries/results.do?fnSearchType=recipe", "title": "Sweet Potato Fries : Food Network", "type": "place", "uuid": "aa3d63f4ff974eb3aa330d1901bbb545", "created": 1328301914760}, {"url": "http://www.foodnetwork.com/recipes/paula-deen/baked-sweet-potato-fries-recipe/index.html", "title": "Baked Sweet Potato Fries Recipe : Paula Deen : Food Network", "type": "place", "uuid": "9f67ac549a994b6183c0a63db8a5ea3b", "created": 1328302090420}, {"url": "http://www.foodnetwork.com/recipe-collections/sweet-potato/index.html", "title": "Sweet Potato Recipes", "type": "place", "uuid": "1265abfdf903441c82351743530839ac", "created": 1328301928426}, {"url": "http://www.foodnetwork.com/recipes/neelys/twice-baked-sweet-potatoes-recipe/index.html", "title": "Twice Baked Sweet Potatoes Recipe : Patrick and Gina Neely : Food Network", "type": "place", "uuid": "8eed3b1118a04602b2675ba783f86091", "created": 1328301944010}, {"url": "http://www.foodnetwork.com/recipes/stuffed-sweet-potato-bites-recipe/index.html", "title": "Stuffed Sweet Potato Bites Recipe : : Food Network", "type": "place", "uuid": "77a370d6dca24299ac78b54e4e5c4ee2", "created": 1328301965509}, {"url": "http://www.foodnetwork.com/recipe-collections/comfort-food/index.html", "title": "No title available", "type": "place", "uuid": "29063d867eb3432e828b9180c30f657f", "created": 1328301973651}], "stack": {"type": "stack", "uuid": "24f76e41ed214b69b95c75d18984828f", "created": 1328301914757}}curl -v -d "`cat ./stacks.json`" -X POST 'http://localhost:4322/lattice/oyiptong@mozilla.com/stack/import'
22
DELETE /lattice/:username/stack/:stack_idDelete this stack. Debug only.curl -v -X DELETE http://localhost:4322/lattice/oyiptong@mozilla.com/stack/fd6b5cd6ec294011a4563c0036d3f412
23
GET /lattice/:username/stack/top_rated

QUERY PARAMS:
l : Integer (Optional) (Default: 9)
p: Integer (Optional) (Default: 1)
Obtains top rated stacks, as well as a [:thumbnails_job] identifier.

Optional parameter 'l' (lowercase l) to set the maximum number of stacks returned. See example. Defaults to 9

Optional parameter 'p' (lowercase p) to set the maximum number of places per stack returned. Note that a stack may return less than this limit. Defaults to 1
?l=3{"d": [{"matches": [{"id": "8e6c35700fce45a2a44b31be90e55fc9", "title": "taste: Definition, Synonyms from Answers.com"}], "stack": {"id": "71dc172f57864c57a930278d665a1a5c", "title": "taste"}}, {"matches": [{"id": "9dcf7b0b05e8438f9ff141ed1b63a7f7", "title": "Armadillo - Wikipedia, the free encyclopedia"}], "stack": {"id": "d3f088104c284662a4e20ed6a2f6c57f", "title": "armadillo"}}]}curl -v -X GET http://localhost:4322/lattice/oyiptong@mozilla.com/stack/top_rated?l=3
24
PUT /lattice/:username/stack/top_rated

POST DATA:
{
stack_id : String,
place_id : String,
}
Resumes a stack, this will create a new session.
It is intended to be used when a user resumes a stack given on the home page.
Takes an active [:place_id] and a [:stack_id].
Returns the [:session_id] of the newly created session
{"stack_id": "f6d87ac9c3b446818db7fdda75010a8b", "place_id": "f6d87ac9c3b446818db7fdda75010a8b"}{"session_id" : "f6d87ac9c3b446818db7fdda75010a8b"}curl -v -d '{"stack_id": "f6d87ac9c3b446818db7fdda75010a8b", "place_id": "f6d87ac9c3b446818db7fdda75010a8b"}' -X PUT 'http://localhost:4322/lattice/oyiptong@mozilla.com/stack/top_rated'
25
GET /lattice/:username/stack/search

QUERY PARAMS:
q : search terms
l : Integer (Optional) (Default: 9)
p: Integer (Optional) (Default: 1)
Execute a search within a user's graph for matching stack/place combinations.

Required parameter 'q' provides terms to iniate search

Optional parameter 'l' (lowercase l) to set the maximum number of stacks returned. See example. Defaults to 9

Optional parameter 'p' (lowercase p) to set the maximum number of places per stack returned. Note that a stack may return less than this limit. Defaults to 1
?q=narwhals+are+awesome&l=2{"d": [{"matches": [{"id": "8e6c35700fce45a2a44b31be90e55fc9", "title": "taste: Definition, Synonyms from Answers.com"}], "stack": {"id": "71dc172f57864c57a930278d665a1a5c", "title": "taste"}}, {"matches": [{"id": "9dcf7b0b05e8438f9ff141ed1b63a7f7", "title": "Armadillo - Wikipedia, the free encyclopedia"}], "stack": {"id": "d3f088104c284662a4e20ed6a2f6c57f", "title": "armadillo"}}]}curl -v http://play.fxhome.mozillalabs.com:4322/lattice/oyiptong@mozilla.com/stack/search?q=ar
26
PUT /lattice/:username/stack/search

POST DATA:
{
stack_id : String,
place_id : String,
search_terms : String
}
Creates a new session given a [:stack_id] and a [:place_id]. This is intended to be used when a user opens an existing stack from search.

Returns the newly created [:session_id]
{"stack_id": "f6d87ac9c3b446818db7fdda75010a8b", "place_id": "f6d87ac9c3b446818db7fdda75010a8b", "search_terms":"narwhals are awesome"}{"session_id" : "f6d87ac9c3b446818db7fdda75010a8b"}
curl -v -d '{"stack_id": "f6d87ac9c3b446818db7fdda75010a8b", "place_id": "f6d87ac9c3b446818db7fdda75010a8b", "search_terms":"narwhals are awesome"}' -X PUT 'http://localhost:4322/lattice/oyiptong@mozilla.com/stack/search'
27
POST /lattice/:username/stack/social/

POST DATA:
{
service_url : String,
friend_url : String,
friend_name : String,
place_title : String,
place_url : String
}
Creates a new stack/browsing session. [:place_url] and [:place_title] parameters is the place the user visits after opening a link from a social source .

There can only be one stack per [:friend_url], which is the url to the friend's profile page. [:service_url] is the name of the social network, e.g. "https://twitter.com" or "http://facebook.com".

Returns a [:session_id], stack, [:profile_place] and [:place] data back

It is a special kind of stack, and the way we handle it in the back-end is different. To the front-end however, it should look like a regular stack.
Therefore, all other API calls work as usual.

This is meant to be used for when a user clicks on a link from a social source.
{
"service_url" : "https://twitter.com",
"friend_url" : "https://twitter.com/#!/jimrossignol",
"friend_name" : "Jim Rossignol",
"place_url" : "http://www.big-robot.com/2012/03/12/and-now-sir-you-are-being-hunted/",
"place_title" : "And Now: Sir, You Are Being Hunted"
}
{
"session_id": "f6d87ac9c3b446818db7fdda75010a8b",
"profile_place": {
"id": "bd45e53204eb43299601b926570613aa",
"thumbnail_key" :"d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f"
},
"place" {
"id": "bd45e53204eb43299601b926570613aa",
"thumbnail_key" :"d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f"
},
"stack" : {
"id": "f6d87ac9c3b446818db7fdda75010a8b",
"title" : "Jim Rossignol"
},
"thumbnails_job" : "f7c3c86e-8ff6-4d5a-ad2b-5991ed771784"
}
curl -v -d '{"service_url" : "https://twitter.com", "friend_url" : "https://twitter.com/#!/jimrossignol", "friend_name" : "Jim Rossignol", "place_url" : "http://www.big-robot.com/2012/03/12/and-now-sir-you-are-being-hunted/", "place_title" : "And Now: Sir, You Are Being Hunted"}' -X POST 'http://localhost:4322/lattice/oyiptong@mozilla.com/stack/social'
28
GET /lattice/:username/stack/:stack_id/sessions

QUERY PARAMS:
places: Integer (Optional) (Default: 0)
Obtains data about all sessions in a stack.

The sessions are in most-recently-visited order.
The number of pages in each session is also returned.

The optional :places query parameter is a developer convenience and will return all places in addition to page counts per-session.
It is either 0 for disabled or 1. The default value is 0.
{"d": [{"page_count": 2, "session_id": "38716050c095443e8d0cd7c575a74836"}, {"page_count": 2, "session_id": "688a68f0bb8841f5bd3d6680c64a1975"}, {"page_count": 1, "session_id": "75fa0f3b42cb4f24b2778eb0c072ffd9"}, {"page_count": 1, "session_id": "41888e5a65164f3e87435d638736b0c7"}, {"page_count": 1, "session_id": "b94770c464cf4b18af02f46ee0b590dc"}]}curl -v 'http://play.fxhome.mozillalabs.com:4322/lattice/oyiptong@mozilla.com/stack/457ab5cb5b5d419daf593739b2f84afb/sessions'
29
GET /lattice/:username/session/:session_idObtains all places in a session, in reverse order of traversal.

i.e. The places will be returned in a most-recently-visited order. If places have been visited multiple times in the same session, only the most recent occurence will be returned.
{"d": [{"url": "http://en.wikipedia.org/wiki/Lamb", "thumbnail_key": "584df05192fa27174e945ef726c0493689e76e73", "id": "a806130a7e614e14b796b236b37d28e8", "title": "Lamb - Wikipedia, the free encyclopedia"}, {"url": "http://www.bing.com/search?q=lamb", "thumbnail_key": "c0cd601517e6e7e0ed0a7c5df5faef97f471e4c2", "id": "8036b451eea4459c9d4fa6ef30bdfe65", "title": "Bing"}], "thumbnails_job": "adbd90e9-f5a8-492a-b4f6-c95c88d8193a"}curl -v 'http://play.fxhome.mozillalabs.com:4322/lattice/oyiptong@mozilla.com/session/2291f5c4806b46d892f76fbee5fb2530'
30
POST /lattice/statsCollect stats from client applications. Requires an authenticated session. There is a whitelist of allowed stats.

Requires an authenticated session.
{"data":[{"js.loadtime":{"timestamp": 1339639106845, "elapsed":1590}}]}curl -v -X POST -d '{"data":[{"js.loadtime":{"timestamp": 1339639106845, "elapsed":1590}}]}' 'http://localhost:6543/lattice/stats'
31
POST /lattice/exceptionsCollect exception logs from client applications.

The format of a valid exception is as follows:

# TODO: add exception message format

Requires an authenticated session.
{"data": [{"stacktrace": {"frames": [{"function": "err", "abs_path": "<ipython-input-4-3cbe8b3c426f>", "vars": {}, "module": "__main__", "filename": "ipython-input-4-3cbe8b3c426f>", "lineno": 3}]}, "exception": {"type": "ZeroDivisionError", "module": "exceptions", "value": "integer division or modulo by zero"}, "culprit": "__main__.err", "server_name": "leap.local", "timestamp": "2012-06-20T20:57:48.299755+00:00", "site": null, "message": "ZeroDivisionError: integer division or modulo by zero"}]}curl -v -X POST -d '{"data": [{"stacktrace": {"frames": [{"function": "err", "abs_path": "<ipython-input-4-3cbe8b3c426f>", "vars": {}, "module": "__main__", "filename": "ipython-input-4-3cbe8b3c426f>", "lineno": 3}]}, "exception": {"type": "ZeroDivisionError", "module": "exceptions", "value": "integer division or modulo by zero"}, "culprit": "__main__.err", "server_name": "leap.local", "timestamp": "2012-06-20T20:57:48.299755+00:00", "site": null, "message": "ZeroDivisionError: integer division or modulo by zero"}]}'
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100