Get the time spent of a person for a week, with one entry per task. Give project_id to keep the tasks of one project. An administrator and the person get all the tasks. A manager gets the tasks of the projects they manage. A supervisor gets the tasks of the projects they supervise, for the task types of their departments. A supervisor without department gets all the task types. A manager or a supervisor who gives a project_id of another project gets a 403. Other users cannot read the time spents of other persons. You cannot read the time spents of a bot. The manager and supervisor roles are the roles held on the project team.
GET
/data/persons/{person_id}/time-spents/week/{year}/{week}
curl
curl -X GET "http://api.example.com/data/persons/a24a6ea4-ce75-4665-a070-57453082c25/time-spents/week/2022/35" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"
import requests
url = "http://api.example.com/data/persons/a24a6ea4-ce75-4665-a070-57453082c25/time-spents/week/2022/35"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json"
}
params = {}
payload = None
response = requests.get(
url,
headers=headers,
params=params,
json=payload
)
response.raise_for_status()
if response.content:
print(response.json())
Response examples (200)
[
{
"task_id": "string",
"task_type_id": "string",
"project_id": "string",
"project_name": "string",
"entity_name": "string",
"entity_type_name": "string",
"sequence_name": "string",
"episode_name": "string",
"duration": 8.5
}
]