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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Trying to login in Confluence using python

Hi,

I am new to confluence and I have been given a task to access our Company's  Confluence's pages programatically.

I found about the REST API call and python's atlassian-python-api  library but none of them seems to be working for me.

The url of confluence page which I am trying to access looks like this :

https://aaa.bbb.com/ccc/ddd/viewpage.action?pageId=80628668

I made below curl request :

curl -u myLoginusername:myLoginpassword-X GET "https://aaa.bbb.com/ccc/ddd/viewpage.action?pageId=80628668" | python -mjson.tool

but I get below response:

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 4933 100 4933 0 0 4933 0 0:00:01 --:--:-- 0:00:01 39464
No JSON object could be decoded

 

when i use atlassian-python-api  in my python script :



from atlassian import Confluence
confluence = Confluence(    url='https://aaa.bbb.com/ccc/ddd/viewpage.action?pageId=80628668',    
username
='myLoginusername',   
password
='myLoginpassword')
status = confluence.get_page_properties(page_id=80628668,)
with open('test.html','w'as f:        f.write(status)
print(status)

 

I am redirected to the login page. Can someone please tell me what am I doing wrong in both cases?

P.S. : I dont have option to create API token in my account.

 

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence

What do you think is the most *delightful* Confluence feature? Comment for a prize!

- Create your own custom emoji 🔥 - "Shake for Feedback" on mobile 📱 - An endless supply of GIFs via GIPHY 🤩 Is there anything quite as nice as a pleasant surprise? Comment below with what...

402 views 23 8
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you