Skip to content

Commit

Permalink
chore: update webhook documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
crookedneighbor committed Aug 20, 2016
1 parent c3b2be2 commit 1f377cc
Showing 1 changed file with 16 additions and 22 deletions.
38 changes: 16 additions & 22 deletions website/server/controllers/api-v3/webhook.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,17 @@ let api = {};
* @apiParam {String} url Body parameter - The webhook's URL
* @apiParam {Boolean} [enabled=true] Body parameter - If the webhook should be enabled
* @apiParam {Sring="taskActivity","groupChatReceived"} [type="taskActivity"] Body parameter - The webhook's type.
* @apiParam {Object} [options] Body parameter - The webhook's options. Wil differ depending on type. Required for `groupChatReceived` type. If a webhook supports options, the dfault values are displayed in the examples below
* @apiParamExample {json} Basic Example (Task Scored)
* {
* "enabled": true,
* "url": "http://some-webhook-url.com"
* }
* @apiParamExample {json} Task Scored With Specified Id Example
* {
* "id": "a-valid-uuid-goes-here",
* "enabled": true,
* "url": "http://some-webhook-url.com",
* "type": "taskActivity"
* }
* @apiParam {Object} [options] Body parameter - The webhook's options. Wil differ depending on type. Required for `groupChatReceived` type. If a webhook supports options, the default values are displayed in the examples below
* @apiParamExample {json} Task Activity Example
* {
* "enabled": true,
* "enabled": true, // default
* "url": "http://some-webhook-url.com",
* "type": "taskActivity",
* "type": "taskActivity", // default
* "options": {
* "created": false,
* "updated": false,
* "deleted": false,
* "scored": true
* "created": false, // default
* "updated": false, // default
* "deleted": false, // default
* "scored": true // default
* }
* }
* @apiParamExample {json} Group Chat Received Example
Expand All @@ -48,6 +36,10 @@ let api = {};
* "groupId": "required-uuid-of-group"
* }
* }
* @apiParamExample {json} Minimal Example
* {
* "url": "http://some-webhook-url.com"
* }
*
* @apiSuccess {Object} data The created webhook
* @apiSuccess {UUID} data.id The uuid of the webhook
Expand All @@ -60,7 +52,8 @@ let api = {};
* @apiError InvalidEnable The `enable` param was not a `Boolean` value
* @apiError InvalidUrl The `url` param was not valid url
* @apiError InvalidWebhookType The `type` param was not a supported Webhook type
* @apiError GroupIdIsNotUUID The `options.groupId` param is not a valid UUID for groupChatReceived webhook type
* @apiError GroupIdIsNotUUID The `options.groupId` param is not a valid UUID for `groupChatReceived` webhook type
* @apiError TaskActivityOptionNotBoolean The `options` provided for the `taskActivity` webhook were not of `Boolean` value
*/
api.addWebhook = {
method: 'POST',
Expand Down Expand Up @@ -114,7 +107,8 @@ api.addWebhook = {
* @apiError InvalidEnable The `enable` param was not a `Boolean` value
* @apiError InvalidUrl The `url` param was not valid url
* @apiError InvalidWebhookType The `type` param was not a supported Webhook type
* @apiError GroupIdIsNotUUID The `options.groupId` param is not a valid UUID for groupChatReceived webhook type
* @apiError GroupIdIsNotUUID The `options.groupId` param is not a valid UUID for `groupChatReceived` webhook type
* @apiError TaskActivityOptionNotBoolean The `options` provided for the `taskActivity` webhook were not of `Boolean` value
*
*/
api.updateWebhook = {
Expand Down Expand Up @@ -161,7 +155,7 @@ api.updateWebhook = {
*
* @apiParam {UUID} id The id of the webhook to delete
*
* @apiSuccess {Object} data The remaining webhooks for the user
* @apiSuccess {Array} data The remaining webhooks for the user
* @apiError WebhookDoesNotExist A webhook with that `id` does not exist
*/
api.deleteWebhook = {
Expand Down

0 comments on commit 1f377cc

Please sign in to comment.