/// <summary> /// The get api token. /// </summary> /// <returns> /// The <see cref="string"/>. /// </returns> private string GetApiToken() { var response = (JObject)Requests.GetJson <object>("https://toggl.com/api/v8/me", credentials: new NetworkCredential(this._username, this._password)); var data = (JObject)response.GetValue("data"); this._apiToken = data.GetValue("api_token").ToString(); this._userId = data.GetValue("id").ToString(); return(this._apiToken); }
public RootObject GetIssues(List <string> issueKey) { var queryString = "key="; queryString += string.Join("+OR+key=", issueKey); var result = Requests.GetJson <RootObject>(string.Format("https://teamvelocitymarketing.atlassian.net/rest/api/2/search?jql={0}&fields=id,key,summary,worklog&maxResults=200", queryString), credentials: new NetworkCredential(_username, _password)); return(result); }
/// <summary> /// The get summary. /// </summary> /// <param name="workspaceId"> /// The workspace id. /// </param> /// <param name="starDate"> /// The star date. /// </param> /// <param name="endDate"> /// The end date. /// </param> /// <returns> /// The <see cref="TogglSummaryReport"/>. /// </returns> public TogglSummaryReport GetSummary(string workspaceId, DateTime starDate, DateTime endDate) { return(Requests.GetJson <TogglSummaryReport>( "https://toggl.com/reports/api/v2/summary?user_agent=jira", credentials: new NetworkCredential(this.ApiToken, "api_token"), queryArgs: new { user_agent = "jira", workspace_id = workspaceId, user_ids = this._userId, since = starDate.ToString("yyyy-MM-dd"), until = endDate.ToString("yyyy-MM-dd") })); }
public Issue GetIssue(string issueKey) { return(Requests.GetJson <Issue>(string.Format("https://teamvelocitymarketing.atlassian.net/rest/api/2/issue/{0}", issueKey), credentials: new NetworkCredential(_username, _password))); }
/// <summary> /// The get work log. /// </summary> /// <param name="issueKey"> /// The issue key. /// </param> /// <returns> /// The <see cref="JiraWorkLog"/>. /// </returns> public JiraWorkLog GetWorkLog(string issueKey) { //"https://teamvelocitymarketing.atlassian.net/rest/api/2/issue/{0}/worklog" return(Requests.GetJson <JiraWorkLog>(string.Format(_url, issueKey), credentials: new NetworkCredential(this._username, this._password))); }