Appearance
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
| Method | Path | Scope | Chức năng |
|---|---|---|---|
GET | /api/v1/content | platform.catalog.read | Danh sách Workflow và Skill cùng lịch sử version. |
GET | /api/v1/content/{componentId} | platform.catalog.read | Chi tiết một component. |
POST | /api/v1/content | platform.catalog.manage | Nhập component mới từ ZIP. |
POST | /api/v1/content/{componentId}/versions | platform.catalog.manage | Tả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.