Loading...
Loading...
Sync API documentation from a Markdown file to Confluence pages using acli + REST API. Prompts for Confluence URL, API doc file path, and credentials at runtime — no pre-configured environment variables required. Use this skill whenever: uploading or syncing API docs to Confluence, updating Confluence pages from a Markdown file, publishing documentation, "sync api doc", "push doc to confluence", "อัปเดต api doc ไป confluence", "sync confluence pages", "confluence-api-doc", or when the user wants to publish or update any Markdown-based documentation to Confluence.
npx skill4agent add witooh/skills confluence-api-docaclicurlParent Folder/Page
├── 2. Consent Management APIs ← domain group page (H2 intro text only)
│ ├── 2.1 Accept Consent ← individual API page (full H3 content)
│ ├── 2.2 Revoke Consents ← individual API page
│ └── 2.3 Get Consents by Citizen ID ← individual API page
├── 3. Purpose Management APIs ← domain group page
│ ├── 3.1 Create Purpose ← individual API page
│ └── 3.2 Get All Purposes ← individual API page
├── 12. Error Responses ← standalone page (H2 with no H3 children)
└── 13. Changelog ← standalone page### X.Y API Namedocs/api-doc.mdhttps://company.atlassian.net/wiki/spaces/PROJ/pages/123456789/API+Referencehttps://company.atlassian.net/wiki/spaces/PROJ/folder/123456789123456789acli auth statusbrew install atlassian/tap/acliacli auth loginSite:https://company.atlassian.nethttps://company.atlassian.netEmail:user@company.comWhy REST API for writes?currently only supportsacli confluence page. For page create/update we use Confluence REST API viaview. URL and email come fromcurl; only the API token needs to be resolved (at write time).acli auth status
## N. Domain Name## 2. Consent Management APIs### N.M API Name### 2.1 Accept ConsentOverviewTable of Contents### X.Y####### 2. Consent Management APIs
Consent APIs for managing personal data consent.
### 2.1 Accept Consent
- **Method:** `POST`
- **Path:** `/api/v1/consents/accept`
...request/response tables and examples...
### 2.2 Revoke Consents
- **Method:** `POST`
- **Path:** `/api/v1/consents/revoke`
..."Consent APIs for managing personal data consent."### 2.1### 2.2### 2.2Found N domain groups, M individual APIs, K standalone pages:
2. Consent Management APIs (5 APIs)
2.1 Accept Consent
2.2 Revoke Consents
2.3 Get Consents by Citizen ID
2.4 Get Consent History
2.5 Get Consent by ID
3. Purpose Management APIs (11 APIs)
3.1 Create Purpose
3.2 Get All Purposes
...
12. Error Responses (standalone)
13. Changelog (standalone)
Total pages to create/update: N (domain groups) + M (APIs) + K (standalone) = T pagesParent page (provided by user)
├── Domain Group pages (H2 with children) ← first-level children
│ └── Individual API pages (H3) ← second-level children
└── Standalone pages (H2 without H3) ← first-level children# Get direct children of parent page
curl -s "${CONFLUENCE_URL}/wiki/rest/api/content/${PARENT_PAGE_ID}?expand=space,children.page" \
-u "${EMAIL}:${API_TOKEN}"space.keySPACE_KEYchildren.page.results[]{id, title}curl -s "${CONFLUENCE_URL}/wiki/rest/api/content/${DOMAIN_GROUP_PAGE_ID}/child/page" \
-u "${EMAIL}:${API_TOKEN}"| Section | Type | Matched Page ID | Action |
|---|---|---|---|
| 2. Consent Management APIs | Domain group | 456789 | Update |
| 2.1 Accept Consent | API page | 567890 | Update |
| 2.2 Revoke Consents | API page | — | Create (under 456789) |
| 3. Purpose Management APIs | Domain group | — | Create (under parent) |
| 3.1 Create Purpose | API page | — | Create (under new domain group page) |
acli confluence page view --id <PAGE_ID> --include-version --jsonversion.numberCURRENT_VERSION| Markdown | Confluence Storage |
|---|---|
| |
| |
| |
| |
| |
| |
jsjavascriptshbashjsonyamlbashshjavascriptjsecho $CONFLUENCE_API_TOKEN"ต้องการ API token สำหรับ write ผ่าน Confluence REST API (acli ยังไม่ support page write) — generate ได้ที่ https://id.atlassian.com/manage-profile/security/api-tokens"
EMAILacli auth statuscurl -s -X POST \
"${CONFLUENCE_URL}/wiki/rest/api/content" \
-u "${EMAIL}:${API_TOKEN}" \
-H "Content-Type: application/json" \
-d "{
\"type\": \"page\",
\"title\": \"${SECTION_TITLE}\",
\"ancestors\": [{\"id\": \"${ANCESTOR_PAGE_ID}\"}],
\"space\": {\"key\": \"${SPACE_KEY}\"},
\"body\": {
\"storage\": {
\"value\": \"${ESCAPED_HTML}\",
\"representation\": \"storage\"
}
}
}"ANCESTOR_PAGE_IDANCESTOR_PAGE_IDANCESTOR_PAGE_IDidcurl -s -X PUT \
"${CONFLUENCE_URL}/wiki/rest/api/content/${PAGE_ID}" \
-u "${EMAIL}:${API_TOKEN}" \
-H "Content-Type: application/json" \
-d "{
\"version\": {\"number\": $((CURRENT_VERSION + 1))},
\"title\": \"${SECTION_TITLE}\",
\"type\": \"page\",
\"body\": {
\"storage\": {
\"value\": \"${ESCAPED_HTML}\",
\"representation\": \"storage\"
}
}
}"Content comparison tip: Before updating, compare normalized content (collapse whitespace) to skip pages with no real changes. This avoids unnecessary version bumps.
| Section | Type | Page ID | Status |
|----------------------------|----------------|------------|-------------------------|
| 2. Consent Management APIs | Domain group | 456789 | Updated (v3 → v4) |
| 2.1 Accept Consent | API page | 567890 | Updated (v2 → v3) |
| 2.2 Revoke Consents | API page | 678901 | Created |
| 2.3 Get Consents | API page | 567890 | Skipped (no changes) |
| 12. Error Responses | Standalone | 789012 | Created |
| 3.1 Create Purpose | API page | — | Failed (HTTP 401) || Scenario | Action |
|---|---|
| Install via |
| Run |
| API doc file not found | Re-ask for correct file path |
| HTTP 401 on REST call | Check API token — re-check |
| HTTP 404 on page | Verify page ID is correct; page may have been deleted |
| HTTP 409 version conflict | Re-fetch version with acli and retry |
| Section title has no match | Ask user to manually provide page ID |