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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

how to login jira cloud with(python) rest api without importing jira module ?

what type of authentication(format) are to be used to login jira cloud 

3 answers

2 votes
Andy Heinzer Atlassian Team Jun 18, 2020

Hi everyone,

I wanted to update this thread as some things have changed.  While you can still use Basic Auth for Jira Cloud REST API, the use of passwords and cookie based auth no longer works. More details in Deprecation notice - Basic authentication with passwords and cookie-based authentication.

Please check out our guide in Basic auth for REST APIs.  It explains in detail that after you have created your Cloud API token, that you then need to build a string in the format of and then base64 encode that string.  You can then pass that encoded string as part of an authorization header for your REST API requests.

Once you have that setup, I'd recommend checking out the Jira Cloud REST API Reference for the endpoint you want to call.  The Cloud version of this document has examples in various language syntax such as python, Java, PHP, Node.js, and cURL.

# This code sample uses the 'requests' library: 

import requests
from requests.auth
import json

url = "/rest/api/3/myself"

headers = {
"Authorization": "Basic [encodedstring]",
"Accept": "application/json"

response = requests.request( "GET", url, headers=headers )

print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))

This should work to make basic auth requests in Jira Cloud from Python.

I hope this helps.


just a question, do we need to use "GET" or "POST" ?

Hey @Andy Heinzer , even i have used that code, I got basic authentication error.

Like Wesam Kiwan likes this

Hi @Andy Heinzer 
can you explain how to use python to authenticate jira hosted on salesforce cloud? 

requests is not defined. How to solve this?

Ben Kelley Atlassian Team Sep 01, 2021

In this article I go over generating a Jira Python client from the Open API spec. The code it generates includes the correct requirements.txt to pull in the required libraries.

0 votes


It is basic authentication, but instead of the password you pass API token:

hi alexey,

i have already tried this code with token  but getting status 200 and html format code is appearing..


import requests
headers = {"content_type":"application/json"},data=body,headers=headers)

Suggest an answer

Log in or Sign up to answer