Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
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

Confluence Cloud 401 Unauthorized API

VL I'm New Here Dec 19, 2021

Hello using python-lib "https://github.com/atlassian-api/atlassian-python-api" I am trying to execute the script but I get this response

HTTPError: Request rejected because issuer is either not authorized or not authorized to impersonate

what is the problem?


from atlassian import Confluence

token = {
'access_token': '<token>',
'token_type': 'bearer'
}

oauth2_dict = {
'client_id': '<id>',
'token': token
}

confluence = Confluence(
url='https://<url>.atlassian.net/wiki',
oauth2=oauth2_dict,
cloud=True)

status = confluence.create_page(
space='DEMO',
title='This is the title',
body='This is the body. You can use <strong>HTML tags</strong>!')

print(status)

1 answer

1 accepted

0 votes
Answer accepted
Pramodh M Community Leader Dec 19, 2021

Hi @VL 

Please try the below code and let me know if this works

confluence = Confluence(
url='https://your-domain.atlassian.net',
username=jira_username,
password=jira_api_token,
cloud=True)

status = confluence.create_page(
space='DEMO',
title='This is the title',
body='This is the body. You can use <strong>HTML tags</strong>!')

print(status)

For more reference, follow the link below

https://atlassian-python-api.readthedocs.io

Thanks,
Pramodh

Pramodh M Community Leader Dec 19, 2021

FYI, use email in place of username

VL I'm New Here Dec 22, 2021

@Pramodh M Everything worked out! Another question, if I add a script to the server, how can I not use personal mail in the script?

Pramodh M Community Leader Dec 22, 2021

@VL Use the Syntax from Documentation

Use the Username and Password/Token

confluence = Confluence(
    url='http://localhost:8090',
    username='admin',
    password='admin')

Thanks,
Pramodh

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence Cloud

🏠 Say hello to the new Confluence Home!

Hi Atlassian Community, My name is DJ Chung, and I’m a Product Manager on the Confluence Cloud team. Today, I’m excited to share a new and improved version of Home. The new Home helps you ...

41,600 views 28 130
Read article

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