Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to use API token in Python so you can push html to a specific page using its ID

Youness Ghanim
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 15, 2020

Please don't refer me to the existing answers about API token for JIRA, I am asking about Confluence.

I have a user name, a password, I know the base URL.

I have installed the Python Atlassian API from https://pypi.org/project/atlassian-python-api/

Before 2020 I was able to simply do:

confluence = Confluence(
url = 'https://confluence.mydomain.com',
username = user_name,
password = pass_word)

Then I invoke:

self.confluence.update_page( page_id = '1234567', title = 'UI automation tests summary', body = page_content, parent_id = '8910111213', type = 'page', representation = 'storage', minor_edit = False)

This worked perfectly fine, but not any more.

When I look around in the community, to my understanding this logging method is not supported anymore I guess and instead, we should use the API token or some other methods, is this correct?

Note that our security team makes it mandatory now to obtain the Microsoft Authenticator token from mobile devices before you log into confluence "two-factor authentication - using Microsoft Authenticator".

Could this be the reason why my Python code is not working anymore? If yes then is there any possible workaround in this case.

 

Thank you

 

1 answer

0 votes
Akhtaruzzaman SM June 15, 2020

I ve a general understanding, contact support just once, ask for the changed situation, but dont wait for an alternative.AKTAR

Suggest an answer

Log in or Sign up to answer