Jira Service Desk API returning 401 from c# web application

This code was working and now it returns a 401 error (System.Net.HttpStatusCode.Unauthorized).

However, if I log into Jira and then open a new tab I can paste in the api call and poof, instant json response. So it appears that the credentials are correct.

I see that other people have this problem and then it starts working again, but that is not the case here. This is really a downer, because since it was working I have a really nice tableau report based on the results that I was saving to a database.

Any help would be appreciated.


        var uriString = "https://journal.atlassian.net/rest/servicedeskapi/request?start=" + start.ToString() + "&limit=" + limit.ToString();
        var uri = new Uri(uriString);

        //var username = "my.email@someplace.com";
        //var password = "mypassword";

        var username = util.GetJiraAPIusername();
        var password = util.GetJiraAPIpassword();

        ViewBag.URI = uri;
        var client = new HttpClient();        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(Encoding.UTF8.GetBytes($"{username}:{password}")));        client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

        HttpResponseMessage response = client.GetAsync(uri).Result;  // Blocking call!
        if (response.IsSuccessStatusCode){ 


1 answer

This doesn't necessarily solve the problem for me due to my vendor support, but Atlassian support provided this information. 


User is a Service Desk portal user. There were changes not so long time ago where Service Desk portal user is not allowed not authenticate via REST API any more.

We are offering API tokens as an alternative for authentication. In order to make it work, your user should be converted to Atlassian Account first. These changes can be done by a site administrator of the Jira instance. Thus, you will need to contact them to clarify this question first.

The following article explains changes and instructions about what should be done, you can pass it to site administrator:

Suggest an answer

Log in or Sign up to answer
Community showcase
Asked Dec 06, 2018 in Jira Service Desk

Looking for teams who switched from email to Jira Service Desk

The Jira Service Desk marketing team is working on a guide to help new Atlassian customers switch from email to JSD and we'd love to hear from you! Please share: - What made you realize that i...

245 views 1 6
View question

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you