Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section
titleExample
Transclusion
documentDocuments Service / PATCH
idsfetch-document-IDs-with-curl

Code Block
languagetext
titlecURL 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
Tip Box

Using curl -n assumes you are using a .netrc file to authenticate. Please see REST Login to Confluence with cURL for more options.

Tip Box

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:

Code Block
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"}]}' 
Code Block
languagejs
titleinsertProperties.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"
      }
    ]
}

...