Commit 16f18227a8239be13dc41e72fcef1e7e5c22e283
Exists in
spb-stable
and in
3 other branches
Merge pull request #6535 from docwhat/sys-hooks-eols
Switched line endings to LF for system_hooks.md
Showing
1 changed file
with
70 additions
and
70 deletions
Show diff stats
doc/api/system_hooks.md
| 1 | -All methods require admin authorization. | |
| 2 | - | |
| 3 | -The url endpoint of the system hooks can be configured in [the admin area under hooks](/admin/hooks). | |
| 4 | - | |
| 5 | -## List system hooks | |
| 6 | - | |
| 7 | -Get list of system hooks | |
| 8 | - | |
| 9 | -``` | |
| 10 | -GET /hooks | |
| 11 | -``` | |
| 12 | - | |
| 13 | -Parameters: | |
| 14 | - | |
| 15 | -+ **none** | |
| 16 | - | |
| 17 | -```json | |
| 18 | -[ | |
| 19 | - { | |
| 20 | - "id":3, | |
| 21 | - "url":"http://example.com/hook", | |
| 22 | - "created_at":"2013-10-02T10:15:31Z" | |
| 23 | - } | |
| 24 | -] | |
| 25 | -``` | |
| 26 | - | |
| 27 | -## Add new system hook hook | |
| 28 | - | |
| 29 | -``` | |
| 30 | -POST /hooks | |
| 31 | -``` | |
| 32 | - | |
| 33 | -Parameters: | |
| 34 | - | |
| 35 | -+ `url` (required) - The hook URL | |
| 36 | - | |
| 37 | - | |
| 38 | -## Test system hook | |
| 39 | - | |
| 40 | -``` | |
| 41 | -GET /hooks/:id | |
| 42 | -``` | |
| 43 | - | |
| 44 | -Parameters: | |
| 45 | - | |
| 46 | -+ `id` (required) - The ID of hook | |
| 47 | - | |
| 48 | -```json | |
| 49 | -{ | |
| 50 | - "event_name":"project_create", | |
| 51 | - "name":"Ruby", | |
| 52 | - "path":"ruby", | |
| 53 | - "project_id":1, | |
| 54 | - "owner_name":"Someone", | |
| 55 | - "owner_email":"example@gitlabhq.com" | |
| 56 | -} | |
| 57 | -``` | |
| 58 | - | |
| 59 | -## Delete system hook | |
| 60 | - | |
| 61 | -Deletes a system hook. This is an idempotent API function and returns `200 Ok` even if the hook | |
| 62 | -is not available. If the hook is deleted it is also returned as JSON. | |
| 63 | - | |
| 64 | -``` | |
| 65 | -DELETE /hooks/:id | |
| 66 | -``` | |
| 67 | - | |
| 68 | -Parameters: | |
| 69 | - | |
| 70 | -+ `id` (required) - The ID of hook | |
| 1 | +All methods require admin authorization. | |
| 2 | + | |
| 3 | +The url endpoint of the system hooks can be configured in [the admin area under hooks](/admin/hooks). | |
| 4 | + | |
| 5 | +## List system hooks | |
| 6 | + | |
| 7 | +Get list of system hooks | |
| 8 | + | |
| 9 | +``` | |
| 10 | +GET /hooks | |
| 11 | +``` | |
| 12 | + | |
| 13 | +Parameters: | |
| 14 | + | |
| 15 | ++ **none** | |
| 16 | + | |
| 17 | +```json | |
| 18 | +[ | |
| 19 | + { | |
| 20 | + "id":3, | |
| 21 | + "url":"http://example.com/hook", | |
| 22 | + "created_at":"2013-10-02T10:15:31Z" | |
| 23 | + } | |
| 24 | +] | |
| 25 | +``` | |
| 26 | + | |
| 27 | +## Add new system hook hook | |
| 28 | + | |
| 29 | +``` | |
| 30 | +POST /hooks | |
| 31 | +``` | |
| 32 | + | |
| 33 | +Parameters: | |
| 34 | + | |
| 35 | ++ `url` (required) - The hook URL | |
| 36 | + | |
| 37 | + | |
| 38 | +## Test system hook | |
| 39 | + | |
| 40 | +``` | |
| 41 | +GET /hooks/:id | |
| 42 | +``` | |
| 43 | + | |
| 44 | +Parameters: | |
| 45 | + | |
| 46 | ++ `id` (required) - The ID of hook | |
| 47 | + | |
| 48 | +```json | |
| 49 | +{ | |
| 50 | + "event_name":"project_create", | |
| 51 | + "name":"Ruby", | |
| 52 | + "path":"ruby", | |
| 53 | + "project_id":1, | |
| 54 | + "owner_name":"Someone", | |
| 55 | + "owner_email":"example@gitlabhq.com" | |
| 56 | +} | |
| 57 | +``` | |
| 58 | + | |
| 59 | +## Delete system hook | |
| 60 | + | |
| 61 | +Deletes a system hook. This is an idempotent API function and returns `200 Ok` even if the hook | |
| 62 | +is not available. If the hook is deleted it is also returned as JSON. | |
| 63 | + | |
| 64 | +``` | |
| 65 | +DELETE /hooks/:id | |
| 66 | +``` | |
| 67 | + | |
| 68 | +Parameters: | |
| 69 | + | |
| 70 | ++ `id` (required) - The ID of hook | ... | ... |