Attempt to fix typos in the API doc

This commit is contained in:
citrusella
2020-02-12 15:40:44 -05:00
parent 142d7e4348
commit 80de90cc5f
7 changed files with 73 additions and 73 deletions

View File

@@ -219,7 +219,7 @@ api.updateUsername = {
}; };
/** /**
* @api {put} /api/v3/user/auth/update-password * @api {put} /api/v3/user/auth/update-password Update password
* @apiDescription Update the password of a local user * @apiDescription Update the password of a local user
* @apiName UpdatePassword * @apiName UpdatePassword
* @apiGroup User * @apiGroup User

View File

@@ -25,7 +25,7 @@ const api = {};
* *
* @apiSuccess {String} Coupons in CSV format * @apiSuccess {String} Coupons in CSV format
* *
* @apiSuccessExample {String} * @apiSuccessExample {String} Example success:
* code,event,date,user * code,event,date,user
* GJG4-WEA4-QX3P,wondercon,1476929528704,user-uuid * GJG4-WEA4-QX3P,wondercon,1476929528704,user-uuid
* TT32-EYQA-JPBT,wondercon,1476929528705, * TT32-EYQA-JPBT,wondercon,1476929528705,

View File

@@ -167,17 +167,17 @@ api.getMemberByUsername = {
* @apiSuccess {Object} data.seasonal The seasonal achievements object * @apiSuccess {Object} data.seasonal The seasonal achievements object
* @apiSuccess {Object} data.special The special achievements object * @apiSuccess {Object} data.special The special achievements object
* *
* @apiSuccess {String} data.*.label The label for that category * @apiSuccess {String} data.label The label for that category
* @apiSuccess {Object} data.*.achievements The achievements in that category * @apiSuccess {Object} data.achievements The achievements in that category
* *
* @apiSuccess {String} data.*.achievements.title The localized title string * @apiSuccess {String} data.achievements.title The localized title string
* @apiSuccess {String} data.*.achievements.text The localized description string * @apiSuccess {String} data.achievements.text The localized description string
* @apiSuccess {Boolean} data.*.achievements.earned Whether the user has earned the achievement * @apiSuccess {Boolean} data.achievements.earned Whether the user has earned the achievement
* @apiSuccess {Number} data.*.achievements.index The unique index assigned * @apiSuccess {Number} data.achievements.index The unique index assigned
* to the achievement (only for sorting purposes). * to the achievement (only for sorting purposes).
* @apiSuccess {Anything} data.*.achievements.value The value related to the achievement * @apiSuccess {Anything} data.achievements.value The value related to the achievement
* (if applicable) * (if applicable)
* @apiSuccess {Number} data.*.achievements.optionalCount The count related to the achievement * @apiSuccess {Number} data.achievements.optionalCount The count related to the achievement
* (if applicable) * (if applicable)
* *
* @apiSuccessExample {json} Successful Response * @apiSuccessExample {json} Successful Response

View File

@@ -45,7 +45,7 @@ function canNotEditTasks (group, user, assignedUserId) {
/** /**
* @apiDefine NotAuthorized * @apiDefine NotAuthorized
* @apiError (401) {NotAuthorized} There is no account that uses those credentials. * @apiError (401) {NotAuthorized} NoAccount There is no account that uses those credentials.
*/ */
const api = {}; const api = {};
@@ -174,7 +174,7 @@ const requiredGroupFields = '_id leader tasksOrder name';
* underscores and dashes. * underscores and dashes.
* @apiError (400) {BadRequest} Value-ValidationFailed `x` is not a valid enum value * @apiError (400) {BadRequest} Value-ValidationFailed `x` is not a valid enum value
* for path `(body param)`. * for path `(body param)`.
* @apiError (401) {NotAuthorized} There is no account that uses those credentials. * @apiError (401) {NotAuthorized} NoAccount There is no account that uses those credentials.
* *
* @apiErrorExample {json} Error-Response: * @apiErrorExample {json} Error-Response:
* { * {
@@ -301,7 +301,7 @@ api.createUserTasks = {
* and dashes. * and dashes.
* @apiError (400) {BadRequest} Value-ValidationFailed `x` is not a valid enum value * @apiError (400) {BadRequest} Value-ValidationFailed `x` is not a valid enum value
* for path `(body param)`. * for path `(body param)`.
* @apiError (401) {NotAuthorized} There is no account that uses those credentials. * @apiError (401) {NotAuthorized} NoAccount There is no account that uses those credentials.
*/ */
api.createChallengeTasks = { api.createChallengeTasks = {
method: 'POST', method: 'POST',
@@ -359,7 +359,7 @@ api.createChallengeTasks = {
* *
* @apiSuccess {Array} data An array of tasks * @apiSuccess {Array} data An array of tasks
* *
* @apiSuccessExample * @apiSuccessExample {json} Example return:
* {"success":true,"data":[{"_id":"8a9d461b-f5eb-4a16-97d3-c03380c422a3", * {"success":true,"data":[{"_id":"8a9d461b-f5eb-4a16-97d3-c03380c422a3",
* "userId":"b0413351-405f-416f-8787-947ec1c85199","text":"15 minute break", * "userId":"b0413351-405f-416f-8787-947ec1c85199","text":"15 minute break",
* "type":"reward","notes":"","tags":[],"value":10,"priority":1,"attribute":"str", * "type":"reward","notes":"","tags":[],"value":10,"priority":1,"attribute":"str",
@@ -379,7 +379,7 @@ api.createChallengeTasks = {
* *
* @apiError (BadRequest) Invalid_request_parameters Error returned if the * @apiError (BadRequest) Invalid_request_parameters Error returned if the
* type URL param was not correct. * type URL param was not correct.
* @apiError (401) {NotAuthorized} There is no account that uses those credentials. * @apiError (401) {NotAuthorized} NoAccount There is no account that uses those credentials.
*/ */
api.getUserTasks = { api.getUserTasks = {
method: 'GET', method: 'GET',
@@ -418,7 +418,7 @@ api.getUserTasks = {
* *
* @apiSuccess {Array} data An array of tasks * @apiSuccess {Array} data An array of tasks
* *
* @apiSuccessExample * @apiSuccessExample {json} Example return:
* {"success":true,"data":[{"_id":"5f12bfba-da30-4733-ad01-9c42f9817975", * {"success":true,"data":[{"_id":"5f12bfba-da30-4733-ad01-9c42f9817975",
* "text":"API Trial","type":"habit","notes":"","tags":[],"value":27.70767809690112, * "text":"API Trial","type":"habit","notes":"","tags":[],"value":27.70767809690112,
* "priority":1.5,"attribute":"str","challenge":{"id":"f23c12f2-5830-4f15-9c36-e17fd729a812"}, * "priority":1.5,"attribute":"str","challenge":{"id":"f23c12f2-5830-4f15-9c36-e17fd729a812"},
@@ -484,7 +484,7 @@ api.getChallengeTasks = {
* *
* @apiSuccess {Object} data The task object * @apiSuccess {Object} data The task object
* *
* @apiSuccessExample {json} Example returned object * @apiSuccessExample {json} Example returned object:
* {"success":true,"data":{"_id":"2b774d70-ec8b-41c1-8967-eb6b13d962ba", * {"success":true,"data":{"_id":"2b774d70-ec8b-41c1-8967-eb6b13d962ba",
* "userId":"b0413351-405f-416f-8787-947ec1c85199","text":"API Trial", * "userId":"b0413351-405f-416f-8787-947ec1c85199","text":"API Trial",
* "alias":"apiTrial","type":"habit","notes":"","tags":[],"value":11.996661122825959, * "alias":"apiTrial","type":"habit","notes":"","tags":[],"value":11.996661122825959,
@@ -911,7 +911,7 @@ api.scoreTask = {
* *
* @apiSuccess {Array} data The new tasks order for the specific type that the taskID belongs to. * @apiSuccess {Array} data The new tasks order for the specific type that the taskID belongs to.
* *
* @apiSuccessExample {json} * @apiSuccessExample {json} Example return:
* {"success":true,"data":["8d7e237a-b259-46ee-b431-33621256bb0b", * {"success":true,"data":["8d7e237a-b259-46ee-b431-33621256bb0b",
* "2b774d70-ec8b-41c1-8967-eb6b13d962ba","f03d4a2b-9c36-4f33-9b5f-bae0aed23a49"], * "2b774d70-ec8b-41c1-8967-eb6b13d962ba","f03d4a2b-9c36-4f33-9b5f-bae0aed23a49"],
* "notifications":[]} * "notifications":[]}
@@ -1362,7 +1362,7 @@ api.removeTagFromTask = {
* should be kept(keep-all) or * should be kept(keep-all) or
* removed(remove-all) after the unlink. * removed(remove-all) after the unlink.
* *
* @apiExample {curl} * @apiExample {curl} Example call:
* curl -X "POST" https://habitica.com/api/v3/tasks/unlink-all/f23c12f2-5830-4f15-9c36-e17fd729a812?keep=remove-all * curl -X "POST" https://habitica.com/api/v3/tasks/unlink-all/f23c12f2-5830-4f15-9c36-e17fd729a812?keep=remove-all
* *
* @apiSuccess {Object} data An empty object * @apiSuccess {Object} data An empty object

View File

@@ -112,8 +112,8 @@ api.getGroupTasks = {
}; };
/** /**
* @api {post} /api/v3/group/:groupId/tasks/:taskId/move/to/:position Move a group task to * @api {post} /api/v3/group/:groupId/tasks/:taskId/move/to/:position
* a specified position * Move a group task to a specified position
* @apiDescription Moves a group task to a specified position * @apiDescription Moves a group task to a specified position
* @apiVersion 3.0.0 * @apiVersion 3.0.0
* @apiName GroupMoveTask * @apiName GroupMoveTask

View File

@@ -91,8 +91,8 @@ api.getUser = {
}; };
/** /**
* @api {get} /api/v3/user/inventory/buy Get the gear items available for purchase * @api {get} /api/v3/user/inventory/buy
* for the authenticated user * Get the gear items available for purchase for the authenticated user
* @apiName UserGetBuyList * @apiName UserGetBuyList
* @apiGroup User * @apiGroup User
* *
@@ -246,7 +246,7 @@ api.updateUser = {
* @apiError {BadRequest} LengthExceeded The feedback provided is longer than 10K * @apiError {BadRequest} LengthExceeded The feedback provided is longer than 10K
* @apiError {BadRequest} NotAuthorized There is no account that uses those credentials. * @apiError {BadRequest} NotAuthorized There is no account that uses those credentials.
* *
* @apiErrorExample {json} * @apiErrorExample {json} Example error:
* { * {
* "success": false, * "success": false,
* "error": "BadRequest", * "error": "BadRequest",
@@ -586,7 +586,7 @@ api.buyArmoire = {
* @apiSuccess {Object} data User's current stats * @apiSuccess {Object} data User's current stats
* @apiSuccess {String} message Success message * @apiSuccess {String} message Success message
* *
* @apiSuccessExample * @apiSuccessExample Example return:
* { * {
* "success": true, * "success": true,
* "data": { * "data": {
@@ -669,7 +669,7 @@ api.buyMysterySet = {
* @apiSuccess {Object} data.quests User's quest list * @apiSuccess {Object} data.quests User's quest list
* @apiSuccess {String} message Success message * @apiSuccess {String} message Success message
* *
* @apiSuccessExample {json} * @apiSuccessExample {json} Success response:
* { * {
* "success": true, * "success": true,
* "data": { * "data": {
@@ -815,7 +815,7 @@ api.hatch = {
* @apiSuccess {Object} data user.items * @apiSuccess {Object} data user.items
* @apiSuccess {String} message Optional success message for unequipping an items * @apiSuccess {String} message Optional success message for unequipping an items
* *
* @apiSuccessExample {json} * @apiSuccessExample {json} Example return:
* { * {
* "success": true, * "success": true,
* "data": {---DATA TRUNCATED---}, * "data": {---DATA TRUNCATED---},
@@ -857,12 +857,12 @@ api.equip = {
* @apiSuccess {Number} data The pet value * @apiSuccess {Number} data The pet value
* @apiSuccess {String} message Success message * @apiSuccess {String} message Success message
* *
* @apiSuccessExample {json} * @apiSuccessExample {json} Example success:
* {"success":true,"data":10,"message":"Shade Armadillo * {"success":true,"data":10,"message":"Shade Armadillo
* really likes the Chocolate!","notifications":[]} * really likes the Chocolate!","notifications":[]}
* *
* @apiError {NotFound} PetNotOwned :pet not found in user.items.pets * @apiError {NotFound} PetNotOwned :pet not found in user.items.pets
* @apiError {BedRequest} InvalidPet Invalid pet name supplied. * @apiError {BadRequest} InvalidPet Invalid pet name supplied.
* @apiError {NotFound} FoodNotOwned :food not found in user.items.food * @apiError {NotFound} FoodNotOwned :food not found in user.items.food
* Note: also sent if food name is invalid. * Note: also sent if food name is invalid.
* *
@@ -913,7 +913,7 @@ api.feed = {
* selected and gems needed to be paid. * selected and gems needed to be paid.
* @apiError {NotAuthorized} Level To change class you must be at least level 10. * @apiError {NotAuthorized} Level To change class you must be at least level 10.
* *
* @apiErrorExample {json} * @apiErrorExample {json} Example error:
* {"success":false,"error":"NotAuthorized","message":"Not enough Gems"} * {"success":false,"error":"NotAuthorized","message":"Not enough Gems"}
*/ */
api.changeClass = { api.changeClass = {
@@ -968,7 +968,7 @@ api.disableClasses = {
* @apiError {NotFound} Key Key not found for Content type. * @apiError {NotFound} Key Key not found for Content type.
* @apiError {NotFound} Type Type invalid. * @apiError {NotFound} Type Type invalid.
* *
* @apiErrorExample {json} * @apiErrorExample {json} Example error:
* {"success":false,"error":"NotAuthorized","message": * {"success":false,"error":"NotAuthorized","message":
* "This item is not currently available for purchase."} * "This item is not currently available for purchase."}
*/ */
@@ -1021,7 +1021,7 @@ api.purchase = {
* @apiError {BadRequest} Quantity Quantity to purchase must be a number. * @apiError {BadRequest} Quantity Quantity to purchase must be a number.
* @apiError {NotFound} Type Type invalid. * @apiError {NotFound} Type Type invalid.
* *
* @apiErrorExample {json} * @apiErrorExample {json} Example error:
* {"success":false,"error":"NotAuthorized","message":"You don't have enough Mystic Hourglasses."} * {"success":false,"error":"NotAuthorized","message":"You don't have enough Mystic Hourglasses."}
*/ */
api.userPurchaseHourglass = { api.userPurchaseHourglass = {
@@ -1055,7 +1055,7 @@ api.userPurchaseHourglass = {
* @apiSuccess {Boolean} data.cardReceived user.flags.cardReceived * @apiSuccess {Boolean} data.cardReceived user.flags.cardReceived
* @apiSuccess {String} message Success message * @apiSuccess {String} message Success message
* *
* @apiSuccessExample {json} * @apiSuccessExample {json} Example success:
* { * {
* "success": true, * "success": true,
* "data": { * "data": {
@@ -1104,7 +1104,7 @@ api.readCard = {
* @apiSuccess {Object} data The item obtained * @apiSuccess {Object} data The item obtained
* @apiSuccess {String} message Success message * @apiSuccess {String} message Success message
* *
* @apiSuccessExample {json} * @apiSuccessExample {json} Example success:
* { "success": true, * { "success": true,
* "data": { * "data": {
* "mystery": "201612", * "mystery": "201612",
@@ -1123,7 +1123,7 @@ api.readCard = {
* *
* @apiError {BadRequest} Empty No mystery items to open. * @apiError {BadRequest} Empty No mystery items to open.
* *
* @apiErrorExample {json} * @apiErrorExample {json} Example error:
* {"success":false,"error":"BadRequest","message":"Mystery items are empty"} * {"success":false,"error":"BadRequest","message":"Mystery items are empty"}
*/ */
api.userOpenMysteryItem = { api.userOpenMysteryItem = {
@@ -1145,7 +1145,7 @@ api.userOpenMysteryItem = {
* @apiSuccess {Object} data.items `user.items.pets` * @apiSuccess {Object} data.items `user.items.pets`
* @apiSuccess {String} message Success message * @apiSuccess {String} message Success message
* *
* @apiSuccessExample {json} * @apiSuccessExample {json} Example success:
* { * {
* "success": true, * "success": true,
* "data": { * "data": {
@@ -1153,9 +1153,9 @@ api.userOpenMysteryItem = {
* "message": "Pets released" * "message": "Pets released"
* } * }
* *
* @apiError {NotAuthorized} Not enough gems * @apiError {NotAuthorized} Gems Not enough gems
* *
* @apiErrorExample {json} * @apiErrorExample {json} Example error:
* {"success":false,"error":"NotAuthorized","message":"Not enough Gems"} * {"success":false,"error":"NotAuthorized","message":"Not enough Gems"}
*/ */
api.userReleasePets = { api.userReleasePets = {
@@ -1180,7 +1180,7 @@ api.userReleasePets = {
* @apiSuccess {Number} data.balance * @apiSuccess {Number} data.balance
* @apiSuccess {String} message Success message * @apiSuccess {String} message Success message
* *
* @apiSuccessExample {json} * @apiSuccessExample {json} Example success:
* { * {
* "success": true, * "success": true,
* "data": { * "data": {
@@ -1201,9 +1201,9 @@ api.userReleasePets = {
* "message": "Mounts and pets released" * "message": "Mounts and pets released"
* } * }
* *
* @apiError {NotAuthorized} Not enough gems * @apiError {NotAuthorized} Gems Not enough gems
* *
* @apiErrorExample {json} * @apiErrorExample {json} Example error:
* {"success":false,"error":"NotAuthorized","message":"Not enough Gems"} * {"success":false,"error":"NotAuthorized","message":"Not enough Gems"}
*/ */
@@ -1227,7 +1227,7 @@ api.userReleaseBoth = {
* @apiSuccess {Object} data user.items.mounts * @apiSuccess {Object} data user.items.mounts
* @apiSuccess {String} message Success message * @apiSuccess {String} message Success message
* *
* @apiSuccessExample {json} * @apiSuccessExample {json} Example success:
* { * {
* "success": true, * "success": true,
* "data": { * "data": {
@@ -1237,9 +1237,9 @@ api.userReleaseBoth = {
* "message": "Mounts released" * "message": "Mounts released"
* } * }
* *
* @apiError {NotAuthorized} Not enough gems * @apiError {NotAuthorized} Gems Not enough gems
* *
* @apiErrorExample {json} * @apiErrorExample {json} Example error:
* {"success":false,"error":"NotAuthorized","message":"Not enough Gems"} * {"success":false,"error":"NotAuthorized","message":"Not enough Gems"}
* *
*/ */
@@ -1262,7 +1262,7 @@ api.userReleaseMounts = {
* *
* @apiParam (Path) {String="eggs","hatchingPotions","food"} type The type of item to sell. * @apiParam (Path) {String="eggs","hatchingPotions","food"} type The type of item to sell.
* @apiParam (Path) {String} key The key of the item * @apiParam (Path) {String} key The key of the item
* @apiParam (Query) {Number} (optional) amount The amount to sell * @apiParam (Query) {Number} [amount] The amount to sell
* *
* @apiSuccess {Object} data.stats * @apiSuccess {Object} data.stats
* @apiSuccess {Object} data.items * @apiSuccess {Object} data.items
@@ -1272,7 +1272,7 @@ api.userReleaseMounts = {
* user has none in inventory). * user has none in inventory).
* @apiError {NotAuthorized} InvalidType Type is not a valid type. * @apiError {NotAuthorized} InvalidType Type is not a valid type.
* *
* @apiErrorExample {json} * @apiErrorExample {json} Example error:
* {"success":false,"error":"NotAuthorized","message":"Type is not sellable. * {"success":false,"error":"NotAuthorized","message":"Type is not sellable.
* Must be one of the following eggs, hatchingPotions, food"} * Must be one of the following eggs, hatchingPotions, food"}
*/ */
@@ -1295,7 +1295,7 @@ api.userSell = {
* *
* @apiParam (Query) {String} path Full path to unlock. See "content" API call for list of items. * @apiParam (Query) {String} path Full path to unlock. See "content" API call for list of items.
* *
* @apiParamExample {curl} * @apiParamExample {curl} Example call:
* curl -X POST http://habitica.com/api/v3/user/unlock?path=background.midnight_clouds * curl -X POST http://habitica.com/api/v3/user/unlock?path=background.midnight_clouds
* curl -X POST http://habitica.com/api/v3/user/unlock?path=hair.color.midnight * curl -X POST http://habitica.com/api/v3/user/unlock?path=hair.color.midnight
* *
@@ -1304,7 +1304,7 @@ api.userSell = {
* @apiSuccess {Object} data.preferences * @apiSuccess {Object} data.preferences
* @apiSuccess {String} message "Items have been unlocked" * @apiSuccess {String} message "Items have been unlocked"
* *
* @apiSuccessExample {json} * @apiSuccessExample {json} Example success:
* { * {
* "success": true, * "success": true,
* "data": {}, * "data": {},
@@ -1315,7 +1315,7 @@ api.userSell = {
* @apiError {NotAuthorized} Gems Not enough gems available. * @apiError {NotAuthorized} Gems Not enough gems available.
* @apiError {NotAuthorized} Unlocked Full set already unlocked. * @apiError {NotAuthorized} Unlocked Full set already unlocked.
* *
* @apiErrorExample {json} * @apiErrorExample {json} Example error:
* {"success":false,"error":"BadRequest","message":"Path string is required"} * {"success":false,"error":"BadRequest","message":"Path string is required"}
* {"success":false,"error":"NotAuthorized","message":"Full set already unlocked."} * {"success":false,"error":"NotAuthorized","message":"Full set already unlocked."}
*/ */
@@ -1342,7 +1342,7 @@ api.userUnlock = {
* *
* @apiError {NotAuthorized} NotDead Cannot revive player if player is not dead yet * @apiError {NotAuthorized} NotDead Cannot revive player if player is not dead yet
* *
* @apiErrorExample {json} * @apiErrorExample {json} Example error:
* {"success":false,"error":"NotAuthorized","message":"Cannot revive if not dead"} * {"success":false,"error":"NotAuthorized","message":"Cannot revive if not dead"}
*/ */
api.userRevive = { api.userRevive = {
@@ -1368,7 +1368,7 @@ api.userRevive = {
* @apiSuccess {Array} data.tasks User's modified tasks (no rewards) * @apiSuccess {Array} data.tasks User's modified tasks (no rewards)
* @apiSuccess {String} message Success message * @apiSuccess {String} message Success message
* *
* @apiSuccessExample {json} * @apiSuccessExample {json} Example success:
* { * {
* "success": true, * "success": true,
* "data": { * "data": {
@@ -1382,9 +1382,9 @@ api.userRevive = {
* ] * ]
* } * }
* *
* @apiError {NotAuthorized} Not enough gems * @apiError {NotAuthorized} Gems Not enough gems
* *
* @apiErrorExample {json} * @apiErrorExample {json} Example error:
* {"success":false,"error":"NotAuthorized","message":"Not enough Gems"} * {"success":false,"error":"NotAuthorized","message":"Not enough Gems"}
*/ */
api.userRebirth = { api.userRebirth = {
@@ -1405,7 +1405,7 @@ api.userRebirth = {
* *
* @apiSuccess {Array} data user.inbox.blocks * @apiSuccess {Array} data user.inbox.blocks
* *
* @apiSuccessExample {json} * @apiSuccessExample {json} Example return:
* {"success":true,"data":["e4842579-g987-d2d2-8660-2f79e725fb79"],"notifications":[]} * {"success":true,"data":["e4842579-g987-d2d2-8660-2f79e725fb79"],"notifications":[]}
* *
* @apiError {BadRequest} InvalidUUID UUID is incorrect. * @apiError {BadRequest} InvalidUUID UUID is incorrect.
@@ -1433,7 +1433,7 @@ api.blockUser = {
* @apiParam (Path) {UUID} id The id of the message to delete * @apiParam (Path) {UUID} id The id of the message to delete
* *
* @apiSuccess {Object} data user.inbox.messages * @apiSuccess {Object} data user.inbox.messages
* @apiSuccessExample {json} * @apiSuccessExample {json} Example return:
* { * {
* "success": true, * "success": true,
* "data": { * "data": {
@@ -1475,7 +1475,7 @@ api.deleteMessage = {
* *
* @apiSuccess {Object} data user.inbox.messages which should be empty * @apiSuccess {Object} data user.inbox.messages which should be empty
* *
* @apiSuccessExample {json} * @apiSuccessExample {json} Example return:
* {"success":true,"data":{},"notifications":[]} * {"success":true,"data":{},"notifications":[]}
*/ */
api.clearMessages = { api.clearMessages = {
@@ -1498,7 +1498,7 @@ api.clearMessages = {
* *
* @apiSuccess {Object} data user.inbox.newMessages * @apiSuccess {Object} data user.inbox.newMessages
* *
* @apiSuccessExample {json} * @apiSuccessExample {json} Example return:
* {"success":true,"data":[0,"Your private messages have been marked as read"],"notifications":[]} * {"success":true,"data":[0,"Your private messages have been marked as read"],"notifications":[]}
* *
*/ */
@@ -1525,7 +1525,7 @@ api.markPmsRead = {
* @apiSuccess {Object} data.tasks User's modified tasks (no rewards) * @apiSuccess {Object} data.tasks User's modified tasks (no rewards)
* @apiSuccess {Object} message Success message * @apiSuccess {Object} message Success message
* *
* @apiSuccessExample {json} * @apiSuccessExample {json} Example success:
* { * {
* "success": true, * "success": true,
* "data": { * "data": {
@@ -1533,9 +1533,9 @@ api.markPmsRead = {
* "message": "Fortify complete!" * "message": "Fortify complete!"
* } * }
* *
* @apiError {NotAuthorized} Not enough gems * @apiError {NotAuthorized} Gems Not enough gems
* *
* @apiErrorExample {json} * @apiErrorExample {json} Example error:
* {"success":false,"error":"NotAuthorized","message":"Not enough Gems"} * {"success":false,"error":"NotAuthorized","message":"Not enough Gems"}
*/ */
api.userReroll = { api.userReroll = {
@@ -1558,7 +1558,7 @@ api.userReroll = {
* @apiSuccess {Array} data.tasksToRemove IDs of removed tasks * @apiSuccess {Array} data.tasksToRemove IDs of removed tasks
* @apiSuccess {String} message Success message * @apiSuccess {String} message Success message
* *
* @apiSuccessExample {json} * @apiSuccessExample {json} Example success:
* { * {
* "success": true, * "success": true,
* "data": {--TRUNCATED--}, * "data": {--TRUNCATED--},
@@ -1580,8 +1580,8 @@ api.userReset = {
}; };
/** /**
* @api {post} /api/v3/user/custom-day-start Set preferences.dayStart * @api {post} /api/v3/user/custom-day-start
* (Custom Day Start time) for user. * Set preferences.dayStart (Custom Day Start time) for user
* @apiName setCustomDayStart * @apiName setCustomDayStart
* @apiGroup User * @apiGroup User
* *
@@ -1595,12 +1595,12 @@ api.userReset = {
* @apiSuccess {Object} data An empty Object * @apiSuccess {Object} data An empty Object
* @apiSuccess {String} message Success message * @apiSuccess {String} message Success message
* *
* @apiSuccessExample {json} * @apiSuccessExample {json} Success-Example:
* {"success":true,"data":{"message":"Your custom day start has changed."},"notifications":[]} * {"success":true,"data":{"message":"Your custom day start has changed."},"notifications":[]}
* *
* @apiError {BadRequest} Validation Value provided is not a number, or is outside the range of 0-23 * @apiError {BadRequest} Validation Value provided is not a number, or is outside the range of 0-23
* *
* @apiErrorExample {json} * @apiErrorExample {json} Error-Example:
* {"success":false,"error":"BadRequest","message":"User validation failed", * {"success":false,"error":"BadRequest","message":"User validation failed",
* "errors":[{"message":"Path `preferences.dayStart` (25) is more than maximum allowed value (23)." * "errors":[{"message":"Path `preferences.dayStart` (25) is more than maximum allowed value (23)."
* ,"path":"preferences.dayStart","value":25}]} * ,"path":"preferences.dayStart","value":25}]}
@@ -1666,8 +1666,8 @@ api.togglePinnedItem = {
}; };
/** /**
* @api {post} /api/v3/user/move-pinned-item/:type/:path/move/to/:position Move a pinned * @api {post} /api/v3/user/move-pinned-item/:type/:path/move/to/:position
* item in the rewards column to a new position after being sorted * Move a pinned item in the rewards column to a new position after being sorted
* @apiName MovePinnedItem * @apiName MovePinnedItem
* @apiGroup User * @apiGroup User
* *
@@ -1678,7 +1678,7 @@ api.togglePinnedItem = {
* *
* @apiSuccess {Array} data The new pinned items order. * @apiSuccess {Array} data The new pinned items order.
* *
* @apiSuccessExample {json} * @apiSuccessExample {json} Example success:
* {"success":true,"data":{"path":"quests.mayhemMistiflying3","type":"quests", * {"success":true,"data":{"path":"quests.mayhemMistiflying3","type":"quests",
* "_id": "5a32d357232feb3bc94c2bdf"},"notifications":[]} * "_id": "5a32d357232feb3bc94c2bdf"},"notifications":[]}
* *

View File

@@ -5,21 +5,21 @@ import { authWithHeaders } from '../../../middlewares/auth';
const api = {}; const api = {};
/** /**
* @api {post} /api/v3/user/allocate Allocate a single Stat Point * @api {post} /api/v3/user/allocate
* (previously called Attribute Point) * Allocate a single Stat Point (previously called Attribute Point)
* @apiName UserAllocate * @apiName UserAllocate
* @apiGroup User * @apiGroup User
* *
* @apiParam (Query) {String="str","con","int","per"} stat The Stat to increase. Default is 'str' * @apiParam (Query) {String="str","con","int","per"} stat The Stat to increase. Default is 'str'
* *
* @apiParamExample {curl} * @apiParamExample {curl} Example call:
* curl -X POST -d "" https://habitica.com/api/v3/user/allocate?stat=int * curl -X POST -d "" https://habitica.com/api/v3/user/allocate?stat=int
* *
* @apiSuccess {Object} data Returns stats and notifications from the user profile * @apiSuccess {Object} data Returns stats and notifications from the user profile
* *
* @apiError {NotAuthorized} NoPoints You don't have enough Stat Points. * @apiError {NotAuthorized} NoPoints You don't have enough Stat Points.
* *
* @apiErrorExample {json} * @apiErrorExample {json} Example error:
* { * {
* "success": false, * "success": false,
* "error": "NotAuthorized", * "error": "NotAuthorized",
@@ -59,7 +59,7 @@ api.allocate = {
* *
* @apiError {NotAuthorized} NoPoints You don't have enough Stat Points. * @apiError {NotAuthorized} NoPoints You don't have enough Stat Points.
* *
* @apiErrorExample {json} * @apiErrorExample {json} Example error:
* { * {
* "success": false, * "success": false,
* "error": "NotAuthorized", * "error": "NotAuthorized",