@noor basha I have already sent you a reply on your previous question.
Here is recap of that,
Displaying attachment on confluence page is another part of story and you will need to fire separate APIs for this.
You need to put something like this in your page body using API,
<ac:image> <ri:attachment ri:filename="atlassian_logo.gif" /> </ac:image>
Here is an working API example, in first API I'm adding image `sample.png` as attachment and later in second API call I'm displaying that in page using Confluence Structure format in body.
curl -D- -u '<USERNAME>:<PASSWORD>' \
-X POST \
-H 'X-Atlassian-Token: nocheck' \
-F 'file=@"./sample.png"' \
curl --request PUT \
--url '<CONFLUNCE_BASE_URL>/rest/api/content/<PAGE_ID>' \
--user '<USERNAME>:<PASSWORD>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
"value":"<p>Adding image to page</p><ac:image><ri:attachment ri:filename=\"sample.png\" /></ac:image>",
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event