Skip to content

API Workflow và Skill

Workflow và Skill được nhập bằng file ZIP đúng chuẩn Nexus. Chỉ Super Admin sử dụng nhóm API này.

Endpoint

MethodPathScopeChức năng
GET/api/v1/contentplatform.catalog.readDanh sách Workflow và Skill cùng lịch sử version.
GET/api/v1/content/{componentId}platform.catalog.readChi tiết một component.
POST/api/v1/contentplatform.catalog.manageNhập component mới từ ZIP.
POST/api/v1/content/{componentId}/versionsplatform.catalog.manageTải version mới và kích hoạt.

componentId nhận numeric ID hoặc component ID trong manifest.json; nên ưu tiên numeric ID.

bash
curl --fail-with-body \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  "$NEXUS_URL/api/v1/content"

export COMPONENT_ID="1"
curl --fail-with-body \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  "$NEXUS_URL/api/v1/content/$COMPONENT_ID"

Nhập component mới

bash
curl --fail-with-body -X POST \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "file=@./sales-customer-profile-1.0.0.zip;type=application/zip" \
  "$NEXUS_URL/api/v1/content"

Cập nhật version

bash
curl --fail-with-body -X POST \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "file=@./sales-customer-profile-1.1.0.zip;type=application/zip" \
  "$NEXUS_URL/api/v1/content/$COMPONENT_ID/versions"

ZIP phải có cùng component ID và type với bản hiện tại; version phải mới hơn và chưa tồn tại.