Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

upload attachment via curl shows 404 not found

Hello everyone.

 

i'm trying to upload file as attachment via curl... but it's shows 404 not found...

i'm following this documentation:

https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content---attachments/#api-wiki-rest-api-content-id-child-attachment-post

 

HTTP/2 404
date: Fri, 06 Oct 2023 09:06:38 GMT
content-type: application/xml;charset=UTF-8
server: AtlassianEdge
timing-allow-origin: *
x-arequestid: 3da2ee41054a480bb06bf2294bf9e3b5
x-seraph-loginreason: AUTHENTICATED_FAILED
set-cookie: atlassian.xsrf.token=a5248455223e43f38a29df9ca9ded53d7fdea435_lout; Path=/; SameSite=None; Secure
cache-control: no-transform
vary: Accept
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
atl-traceid: b94c2e625f098e4c
report-to: {"endpoints": [{"url": "https://dz8aopenkvv6s.cloudfront.net"}], "group": "endpoint-1", "include_subdomains": true, "max_age": 600}
nel: {"failure_fraction": 0.001, "include_subdomains": true, "max_age": 600, "report_to": "endpoint-1"}
strict-transport-security: max-age=63072000; includeSubDomains; preload

 

curl -D- \
-u nurlan.i@domain.com:mypasswd \
-X POST \
-H 'X-Atlassian-Token: nocheck' \
-F 'file=@"helmsman.git"' \
-F 'minorEdit="true"' \
-F 'comment="Example attachment comment"; type=text/plain; charset=utf-8' \
https://mydomain.atlassian.net/rest/api/content/11111111/child/attachment

 

2 answers

Andrii Maliuta
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 06, 2023 • edited

@Nurlan Izimbetov 

Just to clarify do you need to upload Attachment to Confluence or Jira? :)

The error says that you hit the JIRA url, so there must be smth wrong with the endpoint.

The following endpoint should work fine for adding attachments to Confluence as you have '/wiki' after the .net domain and the correct page ID should be present:

https://xxx.atlassian.net/wiki/rest/api/content/467370120/child/attachment

Please make sure the page ID is correct :) 

i need upload attachment to Confluence Cloud.

 

as URL i'm using: https://xxx.atlassian.net/wiki/rest/api/content/870219811/child/attachment

 

 

Thank you.

Continue troubleshooting. 

0 votes
Andrii Maliuta
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 06, 2023

Hello @Nurlan Izimbetov ,

Seems like you missed the '/wiki' part for Confluence URL:

https://mydomain.atlassian.net/wiki/rest/api/content/11111111/child/attachment

almost fixed, i got 401 unathorized.

 

as login i'm using e-mail and password.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events