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

How to call the confluence.append_page() function of the python-api?

Alexander Fedotov May 29, 2022

What exactly does the parameter 'self' in the function

confluence.append_page(self, ...)

on this page https://atlassian-python-api.readthedocs.io/confluence.html

mean? How am I supposed to call this function?

The code on line 1617 and on on this page https://github.com/atlassian-api/atlassian-python-api/blob/master/atlassian/confluence.py is not much of a help.

 

3 answers

0 votes
Andrea August 10, 2022

once you've created your Conflunce object, you can call append page like this:

 

result = conf.append_page(433343488, 'my title', '<p>some more text</p>', 212477418, type='page')

where conf is my confluence object

433343488 is the page id of the page you want to append to and 212477418 is the parent-page ID.

you can get the page-ID by calling get_page('my title')

 

HTH

0 votes
Andrea August 9, 2022

@Alexander Fedotov : did you manage to solve this? because I am facing same issue with the example not helping.

As for your question: 'self' parameter in python refers to the class you are using and usually is not passed at all. simply pretend it is not there. 

once you have created your connection with conf = confluence(url,user, pwd), your variable conf points at an object with all capabilities of the AtlassianConfluenceAPI class. in the definitions of the methods, 'self' is being used as an (internally) passed, but as the user you never have to give that param as it is passed in the background automatically (because it is a class's method).

Alexander Fedotov August 11, 2022

I did. It was a question to a person responsible for the documentation of the SDK.

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 29, 2022

Welcome to the Atlassian Community!

In Confluence-speak, "self" almost always means "the current page".  You'll need to trace that back through the code you are looking at  (Sorry, I've not worked with this library, I've always coded my own direct calls, so I know this is not much help.  Hopefully it gets you on the right path though)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events