Generate secret
POST
/api/projects/{projectId}/sources/{sourceId}/webhook-secretQuản trị viên
Tham số đường dẫn
| Tên | Kiểu | Bắt buộc | Ghi chú |
|---|---|---|---|
projectId | string (uuid) | Bắt buộc | |
sourceId | string (uuid) | Bắt buộc |
Response
Thành công: 200
| Trường | Kiểu | Bắt buộc | Ghi chú |
|---|---|---|---|
id | string (uuid) | Tùy chọn | |
projectId | string (uuid) | Tùy chọn | |
type | enum SourceType | Tùy chọn | GITHUBGITLABLINEARJIRA |
externalProjectKey | string | Tùy chọn | |
externalTeamKey | string | Tùy chọn | |
owner | string | Tùy chọn | |
repository | string | Tùy chọn | |
apiBaseUrl | string | Tùy chọn | |
externalWorkspaceKey | string | Tùy chọn | |
credentialIdentity | string | Tùy chọn | |
webhookAuthMode | enum WebhookAuthMode | Tùy chọn | GITHUB_HMACGITLAB_SIGNING_TOKENGITLAB_SECRET_TOKENLINEAR_HMACNONE |
webhookId | string (uuid) | Tùy chọn | |
webhookPath | string | Tùy chọn | |
webhookSecret | string | Tùy chọn | |
createdAt | string (date-time) | Tùy chọn |
Lỗi
| Trạng thái | Mã | Áp dụng cho |
|---|---|---|
400 | validation_failedthiếu trường hoặc giá trị nằm ngoài khoảng cho phép | Mọi endpoint |
400 | invalid_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 UUID | Mọi endpoint |
401 | authentication_requiredchưa có phiên đăng nhập | Mọi endpoint |
403 | access_deniedendpoint dành cho quản trị viên, hoặc CSRF token thiếu hay đã cũ | Mọi endpoint |
404 | not_foundkhông có địa chỉ đó | Mọi endpoint |
405 | method_not_allowedđịa chỉ không nhận phương thức đó | Mọi endpoint |
415 | unsupported_media_typeđịa chỉ không đọc body thuộc kiểu đó | Mọi endpoint |
500 | internal_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 |
400 | gitlab_base_url_invalid | Khu vực Sources |
400 | gitlab_host_not_allowed | Khu vực Sources |
400 | jira_site_invalid | Khu vực Sources |
400 | github_token_rejected | Khu vực Sources |
400 | gitlab_token_rejected | Khu vực Sources |
400 | linear_token_rejected | Khu vực Sources |
400 | jira_token_rejected | Khu vực Sources |
400 | source_credential_required | Khu vực Sources |
400 | source_signing_token_invalid | Khu vực Sources |
404 | project_not_found | Khu vực Sources |
404 | source_not_found | Khu vực Sources |
409 | github_repository_already_connected | Khu vực Sources |
409 | gitlab_project_already_connected | Khu vực Sources |
409 | linear_team_already_connected | Khu vực Sources |
409 | jira_project_already_connected | Khu vực Sources |
409 | source_token_missing | Khu vực Sources |
409 | source_sync_in_progress | Khu vực Sources |
409 | source_import_not_supported | Khu vực Sources |
409 | source_import_not_resumable | Khu vực Sources |
409 | source_disconnected | Khu vực Sources |
409 | source_not_disconnected | Khu vực Sources |
409 | source_reconnect_required | Khu vực Sources |
409 | source_has_no_webhook | Khu vực Sources |
409 | source_secret_generated | Khu vực Sources |
409 | source_secret_pasted | Khu vực Sources |
503 | github_unavailable | Khu vực Sources |
503 | gitlab_unavailable | Khu vực Sources |
503 | jira_unavailable | Khu 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 POST "http://localhost:8080/api/projects/$PROJECT_ID/sources/$SOURCE_ID/webhook-secret" \
-b cookies.txt -c cookies.txt \
-H "$CSRF_HEADER: $CSRF_TOKEN"
Response
200Ví dụ
{
"id": "<uuid>",
"projectId": "<uuid>",
"type": "GITHUB",
"externalProjectKey": "<string>",
"externalTeamKey": "<string>",
"owner": "<string>",
"repository": "<string>",
"apiBaseUrl": "<string>",
"externalWorkspaceKey": "<string>",
"credentialIdentity": "<string>",
"webhookAuthMode": "GITHUB_HMAC",
"webhookId": "<uuid>",
"webhookPath": "<string>",
"webhookSecret": "<string>",
"createdAt": "<date-time>"
}