File tree Expand file tree Collapse file tree 5 files changed +36
-4
lines changed Expand file tree Collapse file tree 5 files changed +36
-4
lines changed Original file line number Diff line number Diff line change @@ -15,10 +15,19 @@ Containing examples for the [Confluence REST API](https://developer.atlassian.co
1515- Linux / Unix Shell
1616 or
1717- Windows Shell
18- - Cygwin + curl
18+ - Cygwin + Curl
1919 - Intune-Client or
2020 - https://curl.se/windows/
2121
22+ # How to use it
23+
24+ 1 . copy the file ` common/my.cfg.tpl ` to ` ~/.restapi `
25+ 2 . rename the file to ` ~/.restapi\my.cfg `
26+ 3 . edit the file ` ~/.restapi/my.cfg `
27+ - set the variables
28+ - ` CONF_BASE_URL_* ` = URL's of your Confluence instance
29+ - ` CONF_PAT_* ` = Personal access token for authentication
30+
2231# Notice
2332
2433__ Examples are working with privat access token (PAT) only!__
Original file line number Diff line number Diff line change 77#
88# (c) 2024 Oliver Glowa (glo03) / Arvato Systems GmbH
99#
10+ # Call:
11+ # ./browse.sh
12+ #
1013
1114source ./common/env-restapi.sh
1215
Original file line number Diff line number Diff line change 77#
88# (c) 2024 Oliver Glowa (glo03) / Arvato Systems GmbH
99#
10+ # Call:
11+ # ./read-children.sh <PAGE_ID>
12+ #
1013
1114source ./common/env-restapi.sh
1215
Original file line number Diff line number Diff line change 77#
88# (c) 2024 Oliver Glowa (glo03) / Arvato Systems GmbH
99#
10+ # Call:
11+ # ./read.sh
12+ #
1013
1114source ./common/env-restapi.sh
1215
Original file line number Diff line number Diff line change 88# (c) 2024 Oliver Glowa (glo03) / Arvato Systems GmbH
99#
1010# - https://confluence.atlassian.com/confkb/using-the-confluence-rest-api-to-upload-an-attachment-to-one-or-more-pages-1014274390.html
11+ #
12+ # Call:
13+ # ./upload.sh <PAGE_ID> <ATTACHMENT_FILE>
14+ #
15+
16+ source ./common/env-restapi.sh
17+
18+ if [ " $1 " != " " ]; then
19+ PAGE_ID=$1
20+ fi
1121
12- source ./env-restapi.sh
22+ if [ " $2 " != " " ]; then
23+ ATTACHMENT_FILE=$2
24+ fi
1325
14- echo -e " \bDo the upload\n"
26+ echo " Do the upload"
27+ echo " Page ID: ${PAGE_ID} "
28+ echo " File: ${ATTACHMENT_FILE} "
1529
16- curl -s -H " Authorization: Bearer ${CONF_AUTH} " -X POST -H " X-Atlassian-Token: no-check" -F " file=@${ATTACHMENT_FILE} " -F " comment=attached at ${TS} " ${CONF_RESTAPI_URL} /${PAGE_ID} /child/attachment? allowDuplicated=true | jq -r
30+ curl -s -H " ${CONF_AUTH} " -X POST -H " X-Atlassian-Token: no-check" -F " file=@${ATTACHMENT_FILE} " -F " comment=attached at ${TS} " ${CONF_RESTAPI_URL} /${PAGE_ID} /child/attachment? allowDuplicated=true | jq -r
You can’t perform that action at this time.
0 commit comments