Integrating Jira API with C#

Need assistance integrating Jira API in a C# app to fetch DevProject issues. I get either 404 errors or empty replies. See the revised code snippet:

var endpointUrl = "https://mycompany.atlassian.net/rest/api/3/search?jql=project='DevProject'";
var httpReq = (HttpWebRequest)WebRequest.Create(endpointUrl);
httpReq.Method = "GET";
httpReq.Accept = "application/json";
httpReq.Headers["Authorization"] = "Basic " + EncodeAuth("user", "token");
using(var httpResp = httpReq.GetResponse())
using(var streamReader = new StreamReader(httpResp.GetResponseStream())) {
    var resultJson = streamReader.ReadToEnd();
}

The code snippet looks generally fine, but your 404 error might indicate that the endpoint URL isn’t exactly correct for your Jira instance. In my experience, sometimes the issue comes down to URL encoding or improperly formatted JQL. I had a similar problem once where the project key was case-sensitive. It is also useful to ensure that the token and account details are valid and that the project exists in the expected domain. I eventually discovered that switching to HttpClient instead of HttpWebRequest rendered a more informative error response.