Chuyển tới nội dung chính

Replace secret

PUT/api/projects/{projectId}/sources/{sourceId}/webhook-secret
Quản trị viên

Đọc thêm: Đổi webhook secretMã nguồn: ProjectApiController#replaceSecret(mở trong thẻ mới)

Tham số đường dẫn​

TênKiểuBắt buộcGhi chú
projectIdstring (uuid)Bắt buộc
sourceIdstring (uuid)Bắt buộc

Request body​

application/json

TrườngKiểuBắt buộcGhi chú
webhookSecretstringBắt buộcmax 255

Response​

Thành công: 204

Không có response body.

Lỗi​

Trạng tháiMãÁp dụng cho
400validation_failedthiếu trường hoặc giá trị nằm ngoài khoảng cho phépMọi endpoint
400malformed_requestkhông đọc được bodyMọi endpoint
400invalid_parametermột tham số trên đường dẫn hoặc query bị thiếu hoặc không chuyển đổi được, chẳng hạn một ID không phải UUIDMọi endpoint
401authentication_requiredchưa có phiên đăng nhậpMọi endpoint
403access_deniedendpoint dành cho quản trị viên, hoặc CSRF token thiếu hay đã cũMọi endpoint
404not_foundkhông có địa chỉ đóMọi endpoint
405method_not_allowedđịa chỉ không nhận phương thức đóMọi endpoint
415unsupported_media_typeđịa chỉ không đọc body thuộc kiểu đóMọi endpoint
500internal_errormột lỗi ReleaseFlow không lường trước; body không bao giờ chứa exception gây ra nóMọi endpoint
400gitlab_base_url_invalidKhu vực Sources
400gitlab_host_not_allowedKhu vực Sources
400jira_site_invalidKhu vực Sources
400github_token_rejectedKhu vực Sources
400gitlab_token_rejectedKhu vực Sources
400linear_token_rejectedKhu vực Sources
400jira_token_rejectedKhu vực Sources
400source_credential_requiredKhu vực Sources
400source_signing_token_invalidKhu vực Sources
404project_not_foundKhu vực Sources
404source_not_foundKhu vực Sources
409github_repository_already_connectedKhu vực Sources
409gitlab_project_already_connectedKhu vực Sources
409linear_team_already_connectedKhu vực Sources
409jira_project_already_connectedKhu vực Sources
409source_token_missingKhu vực Sources
409source_sync_in_progressKhu vực Sources
409source_import_not_supportedKhu vực Sources
409source_import_not_resumableKhu vực Sources
409source_disconnectedKhu vực Sources
409source_not_disconnectedKhu vực Sources
409source_reconnect_requiredKhu vực Sources
409source_has_no_webhookKhu vực Sources
409source_secret_generatedKhu vực Sources
409source_secret_pastedKhu vực Sources
503github_unavailableKhu vực Sources
503gitlab_unavailableKhu vực Sources
503jira_unavailableKhu vực Sources

Request

bash
# Sign in first and keep the session cookie in cookies.txt (see Sessions and CSRF).
# CSRF_HEADER and CSRF_TOKEN are the headerName and token GET /api/csrf returned.
curl -X PUT "http://localhost:8080/api/projects/$PROJECT_ID/sources/$SOURCE_ID/webhook-secret" \
-b cookies.txt -c cookies.txt \
-H "$CSRF_HEADER: $CSRF_TOKEN" \
-H "Content-Type: application/json" \
--data '{
"webhookSecret": "<string>"
}'

Request body là ví dụ dựng từ schema; thay mọi giá trị giữ chỗ trước khi gửi.

Response

204

Không có response body.