我正在尝试使用下面的api获取我的jira实例的活动流并且它无法正常工作,是否有人能指出我正确的方向?
答案 0 :(得分:1)
只有在您的Feed阅读器中登录时,活动流的Atom Feed才能正常运行。
答案 1 :(得分:1)
这里是使用基本身份验证通过Jira API使用活动流的示例。这在C#中,但是基本模式可以在任何地方应用:
string myJiraUsername = "username";
string myJiraPassword = "password"; //or API token
string authenticationHeaderValue = Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(myJiraUsername + ":" + myJiraPassword));
System.Net.Http.HttpClient client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authenticationHeaderValue);
Task<HttpResponseMessage> task = client.GetAsync("https://mycompany.atlassian.net/activity");
task.Wait();
HttpResponseMessage response = task.Result;
string resultOfApiCall = "";
if (response.IsSuccessStatusCode)
{
resultOfApiCall = response.Content.ReadAsStringAsync().Result;
Console.WriteLine("This was returned by your API request:\n" + resultOfApiCall);
}