JoeyStrandnes / Arduino-Toggl-API

Port of Toggls official API V8
MIT License
7 stars 2 forks source link
api arduino-library esp32 esp32-arduino esp8266 esp8266-arduino rest-api toggl

Arduino Toggl API

PassingGitHub last commitGitHub issuesCodeFactor

Banner

Port of Toggl's official API V8 https://github.com/toggl/toggl_api_docs

Most used API features are implemented

This more of a learning exercise for me so take all the code with a grain of salt.

There is lots of room for optimization and improvement.

Get User Details

getID();                    //Returns ID as integer
getApiToken();              //Returns API Token as String
getDefaultWid();            //Return the default Workspace ID as Int
getEmail();                 //Returns Email as String   
getFullName();              //Returns Name of user as String
getJqTimeOfDayFormat();     //Returns Time of day JQ formatting as String
getJqDateFormat();          //Returns date JQ formatting as String
getTimeOfDayFormat();       //Returns Time of day formatting as String
getDateFormat();            //Returns date formatting as String
getStoreStartAndStopTime(); //Returns START/STOP time as bool
getBeginningOfWeek();       //Returns The day the weeks starts on as uint
getLang();                  //Returns The language used as String
getDurationFormat();        //Returns Duration formatting as String
getAt();                    //Returns AT? as String
getCreation();              //Returns Account creation date as String
getTimezone();              //Returns Time zone as string

Create/Start Time Entries

StartTimeEntry(String Description, String Tags, int PID, String CreatedWith);   // Returns the timer ID as a String
StopTimeEntry(String ID);   //Returns HTTP error in form of string
CreateTimeEntry(String Description, String Tags, int Duration, String Start, int PID, String CreatedWith); // Returns the timer ID as a String
getTimerDuration();     //Returns the duration of the active timer in secconds. Returns 0 if no timer is active.
getTimerID();           //Returns the active timers ID as String. Returns "null" if no timer is active.
isTimerActive();        //Returns a bool if timer is active.

Misc

getWorkSpace();                     // Returns a "pretty" string of all workspaces and ID's
getProject(int const& WID);         // Returns a "pretty" string of all project is specific workplace
CreateTag(String Name, int WID);    // Requires the Workspace ID

General Setup

init(const char* SSID, const char* PASS);   //Starts WiFi connection
setAuth(String const Token);                //Creates Basic authentication key

Dependencies

ArduinoJson v6
ESP8266 default libraries
ESP32 default libraries

Examples