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

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,897
Community Members
 
Community Events
184
Community Groups

create page "POST /wiki/rest/api/content/ HTTP/1.1" 415

Edited

Hi, 

I am trying to create page using python requests module and getting 415. 

here is my python function : 

def create_page(contenturlheaders):
    create_page = {        "type""page",        "title""test",        "space": {"key": space_key},        "ancestors": [{"id": parent_page_id}],        "status""current",        "body": {            "storage": {"value""This is a new page""representation""storage",}        },    }
    response = requests.post(contenturl, data=create_page, headers=headers)    print(response.status_code)

 

here are my headers: 

headers = {    "accept": "application/json",    "authorization": "Basic %s" % encoded,}

 

I do not see authorization is issue here because that i am able to make get content and delete page calls. I have tried adding "X-Atlassian-Token": "no-check" but still gets 415. My user also has full access to write and read.

 

any  help appreciated. 

 

Regards

Sukh

 

1 comment

There was an issue with body. It got resolved after providing body in html format. 

 

 "body": {            "storage": {"value""This is a new page""representation""storage",}        },    }

 

to 

 

"body": {            "storage": {"value": "<p>This is a new page</p>", "representation": "storage",}        },    }

Like Zak Laughton likes this

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events