{ "info": { "title": "1kbIdeas", "version": "1.0.0", "description": "The one-stop shop for all the self-help ideas you need", "termsOfService": "", "contact": { "email": "" }, "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" } }, "basePath": "/api/v1", "swagger": "2.0", "paths": { "/articles/:articleId/comments": { "post": { "description": "Create comment for an article", "produces": [ "application/json" ], "parameters": [ { "name": "Authorization", "in": "header", "required": true, "type": "string", "default": "Bearer {token}" }, { "in": "path", "name": "articleId", "required": true }, { "name": "content", "description": "content of the comment.", "in": "body", "required": true, "type": "string" }, { "name": "repliedToId", "description": "id of comment it is replying to if any.", "in": "body", "type": "string" } ], "responses": { "201": { "description": "comment posted" } } }, "get": { "description": "Get comments for an article", "produces": [ "application/json" ], "parameters": [ { "in": "path", "name": "articleId", "description": "articleId is the unique identifier for the article to get the comments", "required": true, "type": "string" } ], "responses": { "200": { "description": "Comments retrieved successfully" } } } }, "/articles/feed": { "get": { "description": "get paginated followed aticles", "produces": [ "application/json" ], "responses": { "200": { "description": "success" } } } }, "/articles/bookmarks": { "get": { "description": "Get all bookmarked articles", "produces": [ "application/json" ], "responses": { "200": { "description": "Success" } } }, "post": { "description": "Bookmark an article", "produces": [ "application/json" ], "parameters": [ { "in": "path", "name": "articleId", "required": true }, { "name": "userId", "description": "The id of user posting the comment.", "in": "body", "required": true, "type": "string" } ], "responses": { "201": { "description": "article added to bookmark" } } } }, "/bookmarks": { "delete": { "description": "Remove an article from bookmark", "produces": [ "application/json" ], "parameters": [ { "in": "path", "name": "articleId", "required": true }, { "name": "userId", "description": "The id of user posting the comment.", "in": "body", "required": true, "type": "string" } ], "responses": { "200": { "description": "article removed from bookmark" } } } }, "/articles": { "get": { "description": "Search for an article", "produces": [ "application/json" ], "parameters": [ { "in": "path", "name": "SearchArticles", "required": true }, { "name": "tag", "description": "content of the articles.", "in": "query", "required": true, "type": "string" }, { "name": "title", "description": "content of the articles.", "in": "query", "required": true, "type": "string" }, { "name": "author", "description": "associate of the articles model.", "in": "query", "type": "string" }, { "name": "includeSubscriptions", "description": "boolean to include articles in categories user is subscribed to", "in": "query", "type": "boolean" }, { "name": "keyword", "description": "a search query for articles.", "in": "query", "type": "string" } ], "responses": { "200": { "description": "request successful" }, "400": { "description": "keyword cannot be used with title, author or tag" } } } }, "/articles/{articleId}/vote": { "post": { "description": "up vote or down vote an article", "produces": [ "application/json" ], "parameters": [ { "name": "Authorization", "in": "header", "required": true, "type": "string", "default": "Bearer {token}" }, { "name": "Content-Type", "in": "header", "required": true, "type": "string", "default": "application/json" }, { "name": "articleId", "in": "path", "required": true, "type": "string" }, { "name": "voteType", "description": "Vote type. i.e upVote, downVote or nullVote", "in": "formData", "required": true, "type": "string" } ], "responses": { "200": { "description": "Success" } } } }, "/articles/": { "post": { "description": "Create article", "produces": [ "application/json" ], "parameters": [ { "name": "summary", "description": "summary of article.", "in": "body", "required": false, "type": "string" }, { "name": "body", "description": "body of the article.", "in": "body", "required": true, "type": "string" }, { "name": "suspended", "description": "boolean to show if article is suspended or not.", "in": "body", "type": "boolean", "required": false }, { "name": "title", "description": "title of the article.", "in": "body", "type": "string", "required": false }, { "name": "tag", "description": "array of uuid's representing article categories.", "in": "body", "type": "array", "required": false }, { "name": "status", "description": "tells if the article is published or drafted", "in": "body", "type": "string", "required": false } ], "responses": { "201": { "description": "article created" } } } }, "/articles/{slug}": { "get": { "description": "Create a new user", "produces": [ "application/json" ], "parameters": [ { "in": "path", "name": "slug", "required": true } ], "responses": { "200": { "description": "success" } } }, "put": { "description": "Updates an existing article", "produces": [ "application/json" ], "parameters": [ { "name": "summary", "description": "summary of article.", "in": "body", "required": false, "type": "string" }, { "name": "body", "description": "body of the article.", "in": "body", "required": true, "type": "string" }, { "name": "suspended", "description": "boolean to show if article is suspended or not.", "in": "body", "type": "boolean", "required": false }, { "name": "title", "description": "title of the article.", "in": "body", "type": "string", "required": false }, { "name": "tag", "description": "array of uuid's representing article categories.", "in": "body", "type": "array", "required": false }, { "name": "status", "description": "tells if the article is published or drafted", "in": "body", "type": "string", "required": false }, { "in": "path", "name": "slug", "required": true } ], "responses": { "200": { "description": "success" } } }, "delete": { "description": "deletes an article by slug", "produces": [ "application/json" ], "parameters": [ { "in": "path", "name": "slug", "required": true } ], "responses": { "200": { "description": "successful delete" } } } }, "/articles/:articleId/inline_comments": { "post": { "description": "Create an inline comment for an article", "produces": [ "application/json" ], "parameters": [ { "name": "Authorization", "in": "header", "required": true, "type": "string", "default": "Bearer {token}" }, { "in": "path", "name": "articleId", "required": true }, { "name": "content", "description": "content of the comment.", "in": "body", "required": true, "type": "string" }, { "name": "startIndex", "description": "start index of highlight.", "in": "body", "type": "number", "required": true }, { "name": "endIndex", "description": "end index of highlight", "in": "body", "type": "number", "required": true } ], "responses": { "201": { "description": "comment successfully created" } } }, "get": { "description": "Queries inline comments for an article", "produces": [ "application/json" ], "parameters": [ { "in": "path", "name": "articleId", "required": true } ], "responses": { "201": { "description": "comments successfully retrieved" } } } }, "/articles/inline_comments/commentId": { "put": { "description": "Edit an inline comment", "produces": [ "application/json" ], "parameters": [ { "name": "Authorization", "in": "header", "required": true, "type": "string", "default": "Bearer {token}" }, { "in": "path", "name": "commentId", "required": true }, { "name": "content", "description": "content of the comment.", "in": "body", "required": true, "type": "string" }, { "name": "startIndex", "description": "start index of highlight.", "in": "body", "type": "number" }, { "name": "endIndex", "description": "end index of highlight", "in": "body", "type": "number" } ], "responses": { "201": { "description": "comment updated" } } }, "delete": { "description": "Create comment for an article", "produces": [ "application/json" ], "parameters": [ { "name": "Authorization", "in": "header", "required": true, "type": "string", "default": "Bearer {token}" }, { "in": "path", "name": "commentId", "required": true } ], "responses": { "201": { "description": "comment posted" } } }, "get": { "description": "Queries a single inline comment", "produces": [ "application/json" ], "parameters": [ { "in": "path", "name": "commentId", "required": true } ], "responses": { "201": { "description": "Query successfull" } } } }, "/auth/signup": { "post": { "description": "Signup to the application", "produces": [ "application/json" ], "parameters": [ { "name": "userName", "description": "Username to use for login.", "in": "body", "required": true, "type": "string" }, { "name": "firstName", "description": "first name of the user.", "in": "body", "required": true, "type": "string" }, { "name": "lastName", "description": "last name of the user.", "in": "body", "required": true, "type": "string" }, { "name": "email", "description": "email of the user.", "in": "body", "required": true, "type": "string" }, { "name": "password", "description": "User's password.", "in": "body", "required": true, "type": "string" } ], "responses": { "200": { "description": "token is supplied" } } } }, "/auth/signin": { "post": { "description": "Signs in a user", "produces": [ "application/json" ], "parameters": [ { "name": "email", "description": "User object", "in": "body", "required": true, "type": "string" }, { "name": "password", "description": "User object", "in": "body", "required": true, "type": "string" } ], "responses": { "200": { "description": "user successfully signs in" } } } }, "/auth/signout": { "post": { "parameters": [ { "in": "header", "name": "Authorization" } ], "description": "Signs out a user", "produces": [ "application/json" ], "responses": { "200": { "description": "User successfully signed out" } } } }, "/auth/twitter": { "get": { "description": "Authenticate user using twitter", "produces": [ "application/json" ], "responses": { "200": { "description": "success" } } } }, "/auth/twitter/redirect": { "get": { "description": "Create a new user", "produces": [ "application/json" ], "responses": { "200": { "description": "success" } } } }, "/auth/reset_password": { "post": { "description": "Send password reset to user", "produces": [ "application/json" ], "parameters": [ { "name": "email", "description": "user email", "in": "body", "required": true, "type": "string" } ], "responses": { "200": { "description": "success" } } } }, "/auth/update_password/:id/:token": { "patch": { "description": "Update user password", "produces": [ "application/json" ], "parameters": [ { "name": "id", "description": "user id", "in": "params", "required": true, "type": "string" }, { "name": "token", "description": "user token", "in": "params", "required": true, "type": "string" }, { "name": "password", "description": "user password", "in": "body", "required": true, "type": "string" } ], "responses": { "200": { "description": "success" } } } }, "/auth/{provider}": { "post": { "description": "Authenticate user using third party social account", "produces": [ "application/json" ], "parameters": [ { "name": "Content-Type", "in": "header", "required": true, "type": "string", "default": "application/json" }, { "name": "provider", "in": "path", "required": true, "type": "string" }, { "name": "accessToken", "description": "User access token gotten from either facebook or google.", "in": "formData", "required": true, "type": "string" } ], "responses": { "200": { "description": "success" } } } }, "/authors": { "get": { "description": "get a list of all authors", "produces": [ "application/json" ], "responses": { "200": { "description": "authors found" }, "404": { "description": "authors not found" } } } }, "/comments/{commentId}/vote": { "post": { "description": "up vote or down vote a comment", "produces": [ "application/json" ], "parameters": [ { "name": "Authorization", "in": "header", "required": true, "type": "string", "default": "Bearer {token}" }, { "name": "Content-Type", "in": "header", "required": true, "type": "string", "default": "application/json" }, { "name": "commentId", "in": "path", "required": true, "type": "string" }, { "name": "voteType", "description": "Vote type. i.e upVote, downVote or nullVote", "in": "formData", "required": true, "type": "string" } ], "responses": { "200": { "description": "Success" } } } }, "/profile/:id": { "patch": { "description": "update user profile", "produces": [ "application/json" ], "parameters": [ { "name": "userName", "description": "Username to update.", "in": "body", "required": true, "type": "string" }, { "name": "firstName", "description": "first name to update.", "in": "body", "required": true, "type": "string" }, { "name": "lastName", "description": "last name to update.", "in": "body", "required": true, "type": "string" }, { "name": "email", "description": "email to update.", "in": "body", "required": true, "type": "string" }, { "name": "avaterUrl", "description": "image to update.", "in": "body", "required": true, "type": "string" } ], "responses": { "200": { "description": "updated successfully." }, "400": { "description": "not updated." } } }, "get": { "description": "get a user profile", "produces": [ "application/json" ], "parameters": [ { "name": "id", "description": "Username id.", "in": "body", "required": true, "type": "UUID" } ], "responses": { "200": { "description": "request was successful." }, "404": { "description": "user does not exist." } } } }, "/profile/:userId/following": { "patch": { "description": "following a user", "produces": [ "application/json" ], "parameters": [ { "name": "id", "description": "Users id.", "in": "body", "required": true, "type": "UUID" } ], "responses": { "200": { "description": "Successfully followed or unfollowed a user" }, "404": { "description": "User does not exist." }, "409": { "description": "User cannot perform this action." } } } }, "/profile/:userId/followers": { "get": { "description": "get all followers", "produces": [ "application/json" ], "parameters": [ { "name": "id", "description": "Username id.", "in": "body", "required": true, "type": "UUID" } ], "responses": { "200": { "description": "Request was successful." } } } }, "/profile/userId:/followings": { "get": { "description": "get all followings", "produces": [ "application/json" ], "parameters": [ { "name": "id", "description": "Users id.", "in": "body", "required": true, "type": "UUID" } ], "responses": { "200": { "description": "Request was successful." } } } }, "/users/subscriptions": { "post": { "description": "subscribe to categories", "produces": [ "application/json" ], "parameters": [ { "name": "Authorization", "in": "header", "required": true, "type": "string", "default": "Bearer {token}" }, { "name": "Content-Type", "in": "header", "required": true, "type": "string", "default": "application/json" }, { "name": "categories", "description": "A stringified version of an array of categories", "in": "body", "required": true, "schema": { "$ref": "#/definitions/subscription" } } ], "responses": { "200": { "description": "Success" } }, "definitions": { "subscription": { "type": "array", "items": { "type": "string" } } } } } }, "definitions": {}, "responses": {}, "parameters": {}, "securityDefinitions": {}, "tags": [] }