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

List audiences

GET/api/audiences
Quản trị viênChỉ đọc

Đọc thêm: Ngừng dùng một audienceMã nguồn: AudienceApiController#list(mở trong thẻ mới)

Response​

Thành công: 200

Một mảng AudienceView, mỗi phần tử gồm:

TrườngKiểuBắt buộcGhi chú
idstring (uuid)Tùy chọn
codestringTùy chọn
displayNamestringTùy chọn
communicationIntentstringTùy chọn
templateBodystringTùy chọn
footerTemplateBodystringTùy chọn
presetbooleanTùy chọn
createdAtstring (date-time)Tùy chọn
updatedAtstring (date-time)Tùy chọn
templateVariantsmap of stringTùy chọn
footerTemplateVariantsmap of stringTùy chọn
retiredAtstring (date-time)Tùy chọn
retirerNamestringTùy chọn

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
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
400template_invalidKhu vực Audiences
400template_narratives_pathKhu vực Audiences
400template_language_not_targetedKhu vực Audiences
400invalid_release_languagesKhu vực Audiences
404audience_not_foundKhu vực Audiences
409audience_code_takenKhu vực Audiences
409audience_limitKhu vực Audiences
409audience_lastKhu vực Audiences
409audience_last_activeKhu vực Audiences
409audience_already_retiredKhu vực Audiences
409audience_not_retiredKhu vực Audiences
409audience_in_useKhu vực Audiences
409audience_not_presetKhu vực Audiences
404glossary_term_not_foundKhu vực Glossary
409glossary_term_takenKhu vực Glossary
409glossary_limitKhu vực Glossary
400invalid_release_scheduleKhu vực Releases
400invalid_upgrade_guide_urlKhu vực Releases
400invalid_previous_releaseKhu vực Releases
400invalid_fold_decisionKhu vực Releases
404release_not_foundKhu vực Releases
404release_note_not_foundKhu vực Releases
404folding_suggestion_not_foundKhu vực Releases
404linked_issue_not_foundKhu vực Releases
409release_status_conflictKhu vực Releases
409release_publishedKhu vực Releases
409release_emptyKhu vực Releases
409release_review_incompleteKhu vực Releases
409change_summary_requiredKhu vực Releases
409release_version_takenKhu vực Releases
409classification_changedKhu vực Releases
409change_not_releasableKhu vực Releases
409change_excludedKhu vực Releases
409release_note_render_failedKhu vực Releases
409release_notes_missingKhu vực Releases
409translations_not_readyKhu vực Releases
409linked_issue_status_changedKhu vực Releases

Request

bash
# Sign in first and keep the session cookie in cookies.txt (see Sessions and CSRF).
curl "http://localhost:8080/api/audiences" \
-b cookies.txt -c cookies.txt

Response

200

Ví 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>"
  }
]