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

service desk python atlassian api rights issues

Jason Sheldon September 12, 2019

Hi

 

I created an api key and I use 

sd = ServiceDesk(
url=server,
username=email,
password=api_key)

the code to authenticate. In browser I use the same email and my own password

I then try and call these 3 calls

1. print(sd.get_info())
2. print(sd.get_service_desks())
3. print(sd.get_service_desk_by_id('1111111')) 

 

getting back 

1. {'version': '971389ce99a7c7673bf7b9fe2a7083d9109e34c2', 'platformVersion': '971389ce99a7c7673bf7b9fe2a7083d9109e34c2', 'buildDate': {'iso8601': '2019-09-12T16:00:57+1000', 'jira': '2019-09-12T07:00:57.000+0100', 'friendly': 'Yesterday 4:00 PM', 'epochMillis': 1568268057000}, 'buildChangeSet': '971389ce99a7c7673bf7b9fe2a7083d9109e34c2', 'isLicensedForUse': True, '_links': {'self': 'http://xxxxx.atlassian.net'}}
2. None
3. {'message': 'Client must be authenticated to access this resource.', 'status-code': 401}

 In the browser calling the end point for service desks with same email and password i.e. 

GET /rest/servicedeskapi/servicedesk I see all the services desks

Can anyone help with this? ie the discrepency and/or rights issues

2 answers

1 accepted

0 votes
Answer accepted
Jason Sheldon September 17, 2019

Hi In the end it was my token which was bad. I regenerated and it works meaning that the API does work for jira cloud

0 votes
jira guy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 12, 2019

I believe that the python packages you are using works only on server versions. I might be wrong.

 

Btw even though you put xxxx in your url. Link still points to your site. Thought you might want to update it.

Jason Sheldon September 12, 2019

thanks if someone can confirm that this is right will mark as accepted answer and thanks for pointing out on the url. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events