-
Notifications
You must be signed in to change notification settings - Fork 0
API Endpoints
Derek Tsui edited this page Jun 1, 2015
·
17 revisions
| Action | Endpoint | Request Type |
|---|---|---|
| 1. Add Story | /stories/ |
POST |
| 2. Delete Story | /stories/<id> |
DELETE |
| 3. Update Story | /stories/<id> |
PATCH |
| 4. Get Stories | /stories/<id> |
GET |
| 5. Search Story | /stories/search |
POST |
- title (string): Send the title of the snippet.
- text (string): Send the snippet of text.
- parent (int): Send the ID of the parent node that this node is branching from.
- meta (dictionary {"author", "tags"}):
- author (string): Send the username of the author
- tags (array of strings): Relevant tags
- ID of the created node (int)
- i (int): ID of the node
- mongodb document (dictionary) containing the story {"_id","title","text","parent","children","author","time","tags"}
No parameters
- list of mongodb documents (dictionary) containing all stories that HAVE NO PARENTS {"_id","title","text","parent","children","author","time","tags"}
fields to be unchanged should be left as None, except meta, which should be an empty list: []
- i (int): ID of the node
- title (string): the title of the snippet.
- text (string): the snippet of text.
- parent (int): the ID of the parent node that this node is branching from.
- meta (dictionary {"author", "tags"}):
- author (string): Send the username of the author
- tags (array of strings): Relevant tags
- None
- term (string): Search query
- context (string): The document field to be searched: "title", "author", "text", "tags"
- authors (list of strings): A list of the authors by username.
- tags (list of strings): A list of the search tags.
- timeframe (?)
- options
- max (int): The max number of stories to send back not yet implemented
- results (list of nodes): list of mongodb documents (dictionary) containing queried stories