Add properties for a set of documents specified by their IDs.
- Parent
Example
It is typically a good idea to fetch the the list of matching document IDs first. On this result set, use a patch call.
cURL Call
curl -n -X PATCH -H "Content-Type: application/json" \
https://example.com/confluence/rest/projectdoc/1/document?id-list=12845218,12845219,12845221 \
-d @insertProperties.json
Using curl -n assumes you are using a .netrc file to authenticate. Please see REST Login to Confluence with cURL for more options.
insertProperties.json
{
"property": [
{
"name": "Customer Support URL",
"value": "<a href=\"https://example.atlassian.net/servicedesk/customer/portal/1\">Customer Support</a>",
"controls": "",
"position": "after",
"ref": "Short Name"
},
{
"name": "Service Contact",
"value": "<a href=\"mailto:support@example.com\">support@example.com</a>",
"controls": "",
"position": "after",
"ref": "Iteration"
}
]
}
The cURL option -d @filename assumes the data that shall be used to PATCH the given resources is in the given file. If you prefer a one-liner the escaped content of the file must follow directly the -d option:
curl -n -X PATCH -H "Content-Type: application/json" \
https://www.smartics.eu/confluence/rest/projectdoc/1/document.json?id-list=70189553 \
-d '{"property":[{"name":"Customer Support URL","value":"<a href=\"https://example.atlassian.net/servicedesk/customer/portal/1\">Customer Support</a>","controls":"","position":"after","ref":"Short Name"}, "name":"Service Contact","value":"<a href=\"mailto:support@example.com\">support@example.com</a>","controls":"","position":"after","ref":"Iteration"}]}'
Resources
Related information on using REST APIs (with cURL) to integrate with remote information systems.
- REST Login to Confluence with cURL
- To access Confluence via its REST API with cURL you typically need to authenticate. Learn how to login with cURL and avoid some common security pitfalls.
- Accessing projectdoc Properties with cURL
- Learn how to access projectdoc properties via REST API with cURL.
- projectdoc Bulk Changes to Documents
- The Web API Extension for the projectdoc Toolbox can be employed to make bulk changes to documents. Since there is no safety net, these actions need to be take with care. This tip introduces a way to conduct this task.
- Confluence as the Information Hub
- Tools from the projectdoc Toolbox to import from and export to other information systems.
- Import Resource
- Provides services to import information from Maven artifacts into Confluence.