core icon indicating copy to clipboard operation
core copied to clipboard

Implement GET /api/v2/tags/export and /api/v2/tags/export/template endpoints (Tag Export)

Open hassandotcms opened this issue 1 year ago • 1 comments

Task

Context: Part of Feature #32943 (Import/Export Tags) in Tags Portlet Modernization Epic. Implements tag export functionality with CSV/JSON formats and template generation.

Definition of Done:

  • Export endpoint:
    • Format parameter (csv/json, default: csv)
    • Same filtering as listing: filter, global, siteId
    • CSV format: "Tag Name,Host ID"
    • JSON format: structured tag objects
    • Proper file headers (Content-Type, Content-Disposition)
    • Dynamic filename with timestamp
  • Template endpoint:
    • Returns CSV template with headers and examples
    • No parameters required
    • Fixed filename: "tag-import-template.csv"
  • Validation: format (csv/json), siteId (UUID), global (boolean)
  • Error responses: 400, 401, 403, 500
  • Integration tests for both formats and filtering
  • Postman tests for export scenarios

Proposed Objective

Same as Parent Issue

Proposed Priority

Same as Parent Issue

Acceptance Criteria

  1. Export returns downloadable file with correct headers
  2. CSV format matches import template structure
  3. JSON format includes structured tag data
  4. Template endpoint returns example CSV
  5. Invalid format parameter returns 400
  6. Filtering works same as listing endpoint
  7. Requires authentication and Tags portlet access
  8. File generation errors return 500

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

No response

Assumptions & Initiation Needs

No response

Quality Assurance Notes & Workarounds

No response

Sub-Tasks & Estimates

No response

hassandotcms avatar Aug 11 '25 15:08 hassandotcms

PRs linked to this issue

github-actions[bot] avatar Sep 02 '25 11:09 github-actions[bot]