TogglAPI.NetStandard
0.2.14
dotnet add package TogglAPI.NetStandard --version 0.2.14
NuGet\Install-Package TogglAPI.NetStandard -Version 0.2.14
<PackageReference Include="TogglAPI.NetStandard" Version="0.2.14" />
paket add TogglAPI.NetStandard --version 0.2.14
#r "nuget: TogglAPI.NetStandard, 0.2.14"
// Install TogglAPI.NetStandard as a Cake Addin
#addin nuget:?package=TogglAPI.NetStandard&version=0.2.14
// Install TogglAPI.NetStandard as a Cake Tool
#tool nuget:?package=TogglAPI.NetStandard&version=0.2.14
TogglAPI.Net
TogglAPI.Netstandard is a .Net Standard C# wrapper for the toggl.com api This is a Fork of the original code, which updates it to .Net Standard (2.0 - for maximum compatibility). The code is located at: Github - TogglAPI.NetStandard.
Warning!
For correct usage you need to change default client-key. You can find it on bottom of the page (https://www.toggl.com/app/profile). You need a pro version to use tasks, otherwise some tests will fail.
Code Samples
The heavy lifting happens in the dir Toggl/Services. In the services you can create an instance of a service with an api key or a default api key located in the app.config. the api key 2d1d95cef10e17831ec505e9e6f9f7ea is a test account so please use it as you see fit.
Get List Of Clients
var srv = new ClientService();
var obj = srv.List();
###OR
var t = new Toggl.Toggl();
var obj = t.Client.List();
Get Current User
var apiKey="2d1d95cef10e17831ec505e9e6f9f7ea";
var usrSrv = new Toggl.Services.UserService(apiKey);
var c = usrSrv.GetCurrent();
Console.WriteLine(c.FullName);
Console.WriteLine(c.Email);
###OR
var apiKey="2d1d95cef10e17831ec505e9e6f9f7ea";
var t = new Toggl.Toggl(apiKey);
var c = t.User.GetCurrent();
Console.WriteLine(c.FullName);
Console.WriteLine(c.Email);
Get Hours Worked For Time Period
var apiKey="2d1d95cef10e17831ec505e9e6f9f7ea";
var timeSrv= new Toggl.Services.TimeEntryService(apiKey);
var prams = new TimeEntryParams();
// there is an issue with the date ranges have
// to step out of the range on the end.
// To capture the end of the billing range day + 1
prams.StartDate = Convert.ToDateTime("11/1/2012");
prams.EndDate = Convert.ToDateTime("11/16/2012");
var hours = timeSrv.List(prams)
.Where(w=>!string.IsNullOrEmpty(w.Description));
hours.Select(s=>s);
###OR
var timeSrv= new Toggl.Toggl().TimeEntry;
var prams = new TimeEntryParams();
// there is an issue with the date ranges have
// to step out of the range on the end.
// To capture the end of the billing range day + 1
prams.StartDate = Convert.ToDateTime("11/1/2012");
prams.EndDate = Convert.ToDateTime("11/16/2012");
var hours = timeSrv.List(prams)
.Where(w=>!string.IsNullOrEmpty(w.Description));
hours.Select(s=>s).Dump();
For more code samples check out the the Toggl.Tests Project
Copyright
Copyright (c) 2014 Pirozhenko Ilya. See LICENSE for details.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.CSharp (>= 4.4.1)
- Newtonsoft.Json (>= 11.0.2)
- RestSharp (>= 106.2.2)
- System.Configuration.ConfigurationManager (>= 4.4.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.