atlassian-python-api icon indicating copy to clipboard operation
atlassian-python-api copied to clipboard

How to use our API to get servicedesk/customer infos?

Open tuduweb opened this issue 8 months ago • 3 comments

how to use atlassian-python-api to get servicedesk/customer infos? It's that avaliable?

            service_desk = ServiceDesk(
                url=self.server,
                username=self.username,
                password=self.password,
                cloud=True  # Set to False if using Jira Server/Data Center
                # cookies=cookie_dict
            )

           service_desks_info = service_desk.get_service_desks()

but return 401 Client Error: Unauthorized for url: xxx

the server is: https://xxx.atlassian.net

tuduweb avatar May 15 '25 17:05 tuduweb

@tuduweb hello! The code snippet you provided seems correct. The problem most probably is that the feature https://www.atlassian.com/software/jira/service-management/features/service-desk is not enabled for your account.

Just tested it. Before

requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://<my_project_here>.atlassian.net/rest/servicedeskapi/servicedesk

After

[{'id': '1', 'projectId': '10002', 'projectName': 'Support', 'projectKey': 'SUP', '_links': {'self': 'https://<my_project_here>.atlassian.net/rest/servicedeskapi/servicedesk/1'}}]

dunterov avatar May 15 '25 20:05 dunterov

However you mentioned 401. Please check if credentials and url you use are correct.

dunterov avatar May 15 '25 20:05 dunterov

I re-confirm the credentials and url, that's correct. I guess it's because my account is a customer's account? will this have an impact and cause this issues?

tuduweb avatar May 17 '25 02:05 tuduweb