Querying a Webhook of a Specified Repository
Function
This API is used to obtain a webhook of a specified repository.
URI
GET /v1/repositories/{group_name}/{repository_name}/hooks
Parameter | Mandatory | Type | Description |
|---|---|---|---|
group_name | Yes | String | Explanation: Project ID (the segment between the domain name and repository name in a clone address. Example: 2bc940921d964b86951950f5de1axxxx in git@repo.alpha.devcloud.intest.com:2bc940921d964b86951950f5de1axxxx/testword.git). Constraints: None Range: 32 digits and letters. Default value: None |
repository_name | Yes | String | Explanation: Repository name. Constraints: None Range: 2–255 characters, including letters, digits, underscores (_), hyphens (-), periods (.). Default value: None |
Parameter | Mandatory | Type | Description |
|---|---|---|---|
hook_id | No | String | Explanation: Webhook ID. Constraints: None Range: 0–2147483647 Default value: None |
Request Parameters
Parameter | Mandatory | Type | Description |
|---|---|---|---|
X-Auth-Token | Yes | String | Explanation: User token. It can be obtained by calling the corresponding IAM API. The value of X-Subject-Token in the response header is the user token. Constraints: Mandatory Range: 1–100,000 characters. Default value: None |
Response Parameters
Status code: 200
Parameter | Type | Description |
|---|---|---|
error | Error object | Explanation: Response error. Range: None |
result | RepoListHook object | Explanation: Response result. Range: None |
status | String | Explanation: Response status of the API. Range:
|
Parameter | Type | Description |
|---|---|---|
code | String | Explanation: Error code returned when the API fails to be called. Range:
|
message | String | Explanation: Error message returned when the API fails to be called. |
Parameter | Type | Description |
|---|---|---|
id | Integer | Webhook ID. |
project_id | Integer | Repository ID. |
created_at | String | Time when the webhook was created. |
enable_ssl_verification | Boolean | Whether to use SSL authentication. |
push_events | Boolean | Whether to trigger push_events. |
tag_push_events | Boolean | Whether to trigger tag_push_events. |
repository_update_events | Boolean | Whether to trigger repository_update_events. |
merge_requests_events | Boolean | Whether to trigger merge_requests_events. |
issues_events | Boolean | Whether to trigger issues_events. |
note_events | Boolean | Whether to trigger note_events. |
pipeline_events | Boolean | Whether to trigger pipeline_events. |
wiki_page_events | Boolean | Whether to trigger wiki_page_events. |
Example Requests
GET https://{endpoint}/v1/repositories/{group_name}/{repository_name}/hooks Example Responses
Status code: 200
OK
{
"result" : {
"hooks" : [ {
"id" : 2111600786,
"project_id" : 2111615967,
"created_at" : "2021-11-09 16:35:15",
"enable_ssl_verification" : false,
"push_events" : true,
"tag_push_events" : false,
"repository_update_events" : false,
"merge_requests_events" : false,
"issues_events" : false,
"note_events" : false,
"pipeline_events" : false,
"wiki_page_events" : false
} ]
},
"status" : "success"
} Status Codes
Status Code | Description |
|---|---|
200 | OK |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.

