Hi Team,
Not able to upload the documents to confluence page using shell script, getting below error
./test.sh
cat: target_page_id.txt: No such file or directory
Welcome to the Atlassian Community @Abhishek Rana
I think you have not mentioned absolute path of the "target_page_id.txt" file in your test.sh script or it is not yet created hence the not found error.
AB378389@C02FQ7ZZMD6M Desktop % pwd
/Users/AB378389/Desktop
AB378389@C02FQ7ZZMD6M Desktop % ./test.sh
Can you cat the script or paste the lines where target_page_id.txt is mentioned ?
I tried in below way also. But no luck
AB378389@C02FQ7ZZMD6M Desktop % USER_NAME=abhishek.rana2@******.com
USER_PASSWORD=***********
CONFLUENCE_BASE_URL=https://abhishekrana17.atlassian.net/
ATTACHMENT_TYPE=image
ATTACHMENT_FILE_NAME=/Users/AB378389/Desktop/8sept.jpg
PAGE_ID=196757
curl -u $USER_NAME:$USER_PASSWORD \
-X POST \
-H "X-Atlassian-Token: nocheck" -F "file=@${ATTACHMENT_FILE_NAME}" -F "comment=File attached via REST API" \
${CONFLUENCE_BASE_URL}/rest/api/content/${PAGE_ID}/child/attachment 2>/dev/null \
| jq -r '.results[].title'
zsh: command not found: jq
AB378389@C02FQ7ZZMD6M Desktop %
It looks like you're new here. Sign in or register to get started.