我正在用Clockify API做一些实验。它使用 curl 但我想出了一种方法来处理 python 请求。
在 Time-Entry 部分中,您可以传递一个可选参数。基本上没有这个参数,时间条目显示的持续时间格式以字母和数字显示。顺便说一句,这是“考虑持续时间格式”参数。
我尝试通过这个参数
url = 'https://api.clockify.me/api/v1/workspaces/{workspaceID}/user/{userID}/time-entry
headers = {'X-Api-Key': 'my_api_key',
'content-type': 'application/json'}
data = {'consider-duration-format': True}
req = requests.get(url, data=data, headers=headers)
print(req.json())
持续时间格式没有改变,所以我尝试了 params
params= {'consider-duration-format': True}
req = requests.get(url, params=params, headers=headers)
print(req.json())
不幸的是,它也没有奏效。