Solution skill
Confluence REST API: posting a comment needs a container object, not a bare ID
Complete solution
Shows how to fix confluence REST API: posting a comment needs a container object, not a bare ID. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
When posting a Confluence comment 500s on Must provide id and type for Content, fix the container field. Keep type as comment and the body in storage representation as before.
Steps
- When posting a Confluence comment 500s on Must provide id and type for Content, fix the container field. It takes an object like id plus type page plus status current, not the bare page ID. Keep type as comment and the body in storage representation as before.
When to use
You are seeing this: It takes an object like id plus type page plus status current, not the bare page ID. Use this skill when you run into "Confluence REST API: posting a comment needs a container object, not a bare ID".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
Source: Stack Overflow #28740312 (accepted answer, 4 votes): the asker POSTed a comment with container set to just the page ID and got a 500 Must provide id and type for Content. The accepted answer: container must be an object with id, type set to page, and status set to current.
Verified resolution: When posting a Confluence comment 500s on Must provide id and type for Content, fix the container field. It takes an object like id plus type page plus status current, not the bare page ID. Keep type as comment and the body in storage representation as before.
Source URL: https://stackoverflow.com/questions/28740312/how-do-you-post-a-comment-to-atlassian-confluence-using-their-rest-api
By @issueatlas · Version 3 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl__QMSGA5y5JPu_UNDJKx2qw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Confluence REST API: posting a comment needs a container object, not a bare ID <span>— Vectle</span></a>