chore(docs): Update group invite docs

This commit is contained in:
Blade Barringer
2016-09-30 11:23:31 -05:00
parent 24562f8d60
commit edac06b0d1

View File

@@ -641,18 +641,45 @@ async function _inviteByEmail (invite, group, inviter, req, res) {
} }
/** /**
* @api {post} /api/v3/groups/:groupId/invite Invite users to a group using their UUIDs or email addresses * @api {post} /api/v3/groups/:groupId/invite Invite users to a group
* @apiVersion 3.0.0
* @apiName InviteToGroup * @apiName InviteToGroup
* @apiGroup Group * @apiGroup Group
* @apiDescription You can provide both `emails` and `uuids`, or just one. You must provide at least one.
* *
* @apiParam {String} groupId The group _id ('party' for the user party and 'habitrpg' for tavern are accepted) * @apiParam {String} groupId The group _id ('party' for the user party and 'habitrpg' for tavern are accepted)
* *
* @apiParam {Array} emails Body parameter - An array of emails addresses to invite (optional) * @apiParam {Array} [emails] Body parameter - An array of emails addresses to invite
* @apiParam {Array} uuids Body parameter - An array of uuids to invite (optional) * @apiParam {Array} [uuids] Body parameter - An array of uuids to invite
* @apiParam {String} inviter Body parameter - The inviters' name (optional) *
* @apiParamExample {json} Emails
* {
* "emails": ["user-1@example.com", "user-2@exmaple.com"]
* }
* @apiParamExample {json} User Ids
* {
* "uuids": ["user-id-of-existing-user", "user-id-of-another-existing-user"]
* }
* @apiParamExample {json} User Ids and Emails
* {
* "emails": ["user-1@example.com", "user-2@exmaple.com"],
* "uuids": ["user-id-of-existing-user", "user-id-of-another-existing-user"],
* }
* *
* @apiSuccess {Array} data The invites * @apiSuccess {Array} data The invites
* @apiSuccess {Object} data[0] If the invitation was a user id, you'll receive back an object. You'll recieve one Object for each succesful user id invite.
* @apiSuccess {String} data[1] If the invitation was an email, you'll receive back the email. You'll recieve one String for each successful email invite.
*
* @apiSuccessExample {json} Successful Response
* {
* data: [
* { id: 'the-id-of-the-invited-user', name: 'The group name', inviter: 'your-user-id' },
* "user@example.com"
* ]
* }
*
* @apiError GroupNotFound The group could not be found
* @apiError InvalidInvitationParams An error relating to the data sent in `emails` and/or `uuids`
* @apiError TooManyInvites A max of 100 invites (combined emails and user ids) can be sent out at a time
*/ */
api.inviteToGroup = { api.inviteToGroup = {
method: 'POST', method: 'POST',