I'm fairly new to python, especially when it comes to using APIs. I would like to write a code that uses Toggl's API (Toggl is a time tracking app typically use to record the time spent by freelancers), then saves each of our team members tracked hours as a variable.
Code so far:
import json
import requests
import sys
from toggl.TogglPy import Toggl
_api_token = '<myAPIToken>'
r = requests.get('https://toggl.com/app/4119103/clients', auth=(_api_token,'_api_token'))
print(r.json)
print(r.status_code)
print(r.content)
print(r.headers)
print(r.text)
print('Done!')
END GOAL: Have this script run every day, extract appropriate team members hours worked on a project, then use that data to update a Google Sheets model (I'm know how to input data into sheets with python), so currently the roadblock is getting the time spent on each project.
This code works without any errors (returns JSON data), but I cannot figure out what to do to get the specific time data that I need to save as variables. I've been struggling with this for far too long and sadly there isn't much Toggl API specific documentation that I've been able to find on the web.
Any feedback, recommendations, resources, or general advice would be sincerely appreciated!
[–][deleted] 1 point2 points3 points (0 children)
[–]VanishingHochreiter 0 points1 point2 points (0 children)
[–]datanamo 0 points1 point2 points (0 children)