"Approvals" Endpoints - GET Get timesheets

https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/timesheets

Get timesheets applying various filters.

  • cURL
  • Go
  • Ruby
  • JavaScript
  • Python
  • Rust
extern crate tokio;extern crate serde_json;use reqwest::{Client};use reqwest::header::{CONTENT_TYPE};#[tokio::main]async fn main() -> Result<(), reqwest::Error> {  let client = Client::new().basic_auth("<email>", "<password>");  let json = client.request(Method::GET, "https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/timesheets".to_string())  .header(CONTENT_TYPE, "application/json")  .send()  .await?  .json()  .await?;    println!("{:#?}", json);  Ok(())}

Parameters

Path

name type required description
workspace_id integer true Numeric ID of the workspace

Query

name type required description
member_ids integer false Numeric ID of the members, comma-separated
approver_ids integer false Numeric ID of the approvers, comma-separated
timesheet_setup_ids integer false Numeric ID for timesheet setup, comma-separated.
statuses integer false Timesheet status, comma-separated.
before integer false Timesheets starting before this date (YYYY-MM-DD).
after integer false Timesheets starting after this date (YYYY-MM-DD).
page integer false Page number, default 1.
per_page integer false Number of items per page, default 20. Also defaults to 20 if provided an greater than 1000.
sort_field string false Field used for sorting, default start_date.
sort_order string false Sort order.

Response

200

Name Type Description
items Array of object -
items
Name Type Description
data Array of object -
page integer -
per_page integer -
total_count integer -
data
Name Type Description
approved_or_rejected_at string -
approved_or_rejected_id integer -
approved_or_rejected_name string -
approver_id integer -
approver_name string -
approvers Array of object -
end_date string -
errors Array of object -
member_id integer -
member_name string -
period_editable boolean -
period_end string -
period_locked boolean -
period_start string -
periodicity string -
permissions string -
rejection_comment string -
reminder_day string -
reminder_sent_at string -
reminder_time string -
reviews Array of object -
start_date string -
status string -
submitted_at string -
timesheet_setup_id integer -
working_hours_in_minutes integer -
workspace_id integer -
approvers
Name Type Description
name string -
user_id integer -
errors
Name Type Description
code string -
message string -
reviews
Name Type Description
approved boolean -
name string -
rejection_comment string -
user_id integer -

400

Possible error messages:

  • Workspace not found
  • Invalid ID
  • Invalid date
  • Invalid status

402

Approvals are a premium feature

403

User does not have access to this resource

500

Internal Server Error