Skip to content

Instantly share code, notes, and snippets.

@GrillPhil
Created May 31, 2018 20:20
Show Gist options
  • Save GrillPhil/a32c8299cd7de21302898e9e6b3f3f96 to your computer and use it in GitHub Desktop.
Save GrillPhil/a32c8299cd7de21302898e9e6b3f3f96 to your computer and use it in GitHub Desktop.
Step 5
private static async Task<IEnumerable<TimeEntry>> GetTimeEntriesForProject(HttpClient httpClient, string tenant, string apiKey, string baseUrl, int projectId)
{
var requestUrl = string.Format(baseUrl, tenant, $"time_entries.json?project_id={projectId}&", apiKey);
var response = await httpClient.GetStringAsync(requestUrl);
return (JsonConvert.DeserializeObject<IEnumerable<TimeEntryWrapper>>(response)).Select(wrapper => wrapper.TimeEntry);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment