G
G
god_dan632021-11-15 11:15:46
Python
god_dan63, 2021-11-15 11:15:46

How to modify pages in confluence-rest-api????

Good afternoon!
I can't figure out how to change the page code in confluence-rest-api.
I try through the put method from requests, nothing comes out.
I need to change the table on the page, I don't know how to do it. (Need to be inserted into a row in one of the columns)

I'm trying to follow this example:

def set_page_json(page_id,json_content):
    headers = {
        'Content-Type': 'application/json',
    }

    response = requests.put("https://confluence.corporation.com/rest/api/content/" + page_id, headers=headers, data=json.dumps(json_content),
                 auth=(user, password))
    return(response.text)

1) Why do we need headers? And where can I get these headers
2) What is meant by json_content? Is it just json code that I want to insert?
3)How to edit tables through this?? table itself in html

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question