Update template
PUT
/api/audiences/{audienceId}/templates/{language}Quản trị viên
Mỗi audience có template riêng cho từng ngôn ngữ release note mà ngôn ngữ đầu ra không bao phủ, được tạo khi thêm ngôn ngữ hoặc thêm audience: một audience mẫu bắt đầu từ template đi kèm của nó bằng ngôn ngữ đó, với các nhãn đã dịch, còn mọi audience khác bắt đầu từ bản sao template chính của nó. Sửa chúng trong mục Template theo ngôn ngữ trên trang của audience, hoặc gọi PUT /api/audiences/{audienceId}/templates/{language}. Đặt lại một audience mẫu cũng đặt lại các template này.
Tham số đường dẫn
| Tên | Kiểu | Bắt buộc | Ghi chú |
|---|---|---|---|
audienceId | string (uuid) | Bắt buộc | |
language | string | Bắt buộc |
Request body
application/json
| Trường | Kiểu | Bắt buộc | Ghi chú |
|---|---|---|---|
templateBody | string | Tùy chọn | |
footerTemplateBody | string | Tùy chọn |
Response
Thành công: 200
| Trường | Kiểu | Bắt buộc | Ghi chú |
|---|---|---|---|
id | string (uuid) | Tùy chọn | |
code | string | Tùy chọn | |
displayName | string | Tùy chọn | |
communicationIntent | string | Tùy chọn | |
templateBody | string | Tùy chọn | |
footerTemplateBody | string | Tùy chọn | |
preset | boolean | Tùy chọn | |
createdAt | string (date-time) | Tùy chọn | |
updatedAt | string (date-time) | Tùy chọn | |
templateVariants | map of string | Tùy chọn | |
footerTemplateVariants | map of string | Tùy chọn | |
retiredAt | string (date-time) | Tùy chọn | |
retirerName | string | 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 | malformed_requestkhông đọc được body | 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 | template_invalid | Khu vực Audiences |
400 | template_narratives_path | Khu vực Audiences |
400 | template_language_not_targeted | Khu vực Audiences |
400 | invalid_release_languages | Khu vực Audiences |
404 | audience_not_found | Khu vực Audiences |
409 | audience_code_taken | Khu vực Audiences |
409 | audience_limit | Khu vực Audiences |
409 | audience_last | Khu vực Audiences |
409 | audience_last_active | Khu vực Audiences |
409 | audience_already_retired | Khu vực Audiences |
409 | audience_not_retired | Khu vực Audiences |
409 | audience_in_use | Khu vực Audiences |
409 | audience_not_preset | Khu vực Audiences |
404 | glossary_term_not_found | Khu vực Glossary |
409 | glossary_term_taken | Khu vực Glossary |
409 | glossary_limit | Khu vực Glossary |
400 | invalid_release_schedule | Khu vực Releases |
400 | invalid_upgrade_guide_url | Khu vực Releases |
400 | invalid_previous_release | Khu vực Releases |
400 | invalid_fold_decision | Khu vực Releases |
404 | release_not_found | Khu vực Releases |
404 | release_note_not_found | Khu vực Releases |
404 | folding_suggestion_not_found | Khu vực Releases |
404 | linked_issue_not_found | Khu vực Releases |
409 | release_status_conflict | Khu vực Releases |
409 | release_published | Khu vực Releases |
409 | release_empty | Khu vực Releases |
409 | release_review_incomplete | Khu vực Releases |
409 | change_summary_required | Khu vực Releases |
409 | release_version_taken | Khu vực Releases |
409 | classification_changed | Khu vực Releases |
409 | change_not_releasable | Khu vực Releases |
409 | change_excluded | Khu vực Releases |
409 | release_note_render_failed | Khu vực Releases |
409 | release_notes_missing | Khu vực Releases |
409 | translations_not_ready | Khu vực Releases |
409 | linked_issue_status_changed | Khu vực Releases |
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/audiences/$AUDIENCE_ID/templates/$LANGUAGE" \
-b cookies.txt -c cookies.txt \
-H "$CSRF_HEADER: $CSRF_TOKEN" \
-H "Content-Type: application/json" \
--data '{
"templateBody": "<string>",
"footerTemplateBody": "<string>"
}'
Request body là ví dụ dựng từ schema; thay mọi giá trị giữ chỗ trước khi gửi.
Response
200Ví dụ
{
"id": "<uuid>",
"code": "<string>",
"displayName": "<string>",
"communicationIntent": "<string>",
"templateBody": "<string>",
"footerTemplateBody": "<string>",
"preset": false,
"createdAt": "<date-time>",
"updatedAt": "<date-time>",
"templateVariants": {
"<key>": "<string>"
},
"footerTemplateVariants": {
"<key>": "<string>"
},
"retiredAt": "<date-time>",
"retirerName": "<string>"
}