Exports
POST Export employee profitability insights​
https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/profitability/employees.{extension}
Downloads employee profitability insights in the specified format: csv or xlsx.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/profitability/employees.{extension} \
-H "Content-Type: application/json" \
-d '{"currency":"string","end_date":"string","group_ids":"string","resolution":"string","rounding":"integer","rounding_minutes":"integer","start_date":"string","user_ids":"string"}' \
-u <email>:<password>
bytes, err := json.Marshal('{"currency":"string","end_date":"string","group_ids":"string","resolution":"string","rounding":"integer","rounding_minutes":"integer","start_date":"string","user_ids":"string"}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/profitability/employees.{extension}", bytes.NewBuffer(bytes))
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/profitability/employees.{extension}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
req.body = {"currency":"string","end_date":"string","group_ids":"string","resolution":"string","rounding":"integer","rounding_minutes":"integer","start_date":"string","user_ids":"string"}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/profitability/employees.{extension}", {
method: "POST",
body: {"currency":"string","end_date":"string","group_ids":"string","resolution":"string","rounding":"integer","rounding_minutes":"integer","start_date":"string","user_ids":"string"},
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${base64.encode(<email>:<password>)}`
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.post('https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/profitability/employees.{extension}', json={"currency":"string","end_date":"string","group_ids":"string","resolution":"string","rounding":"integer","rounding_minutes":"integer","start_date":"string","user_ids":"string"}, headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' % b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
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::POST, "https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/profitability/employees.{extension}".to_string())
.json(&serde_json::json!({"currency":"string","end_date":"string","group_ids":"string","resolution":"string","rounding":"integer","rounding_minutes":"integer","start_date":"string","user_ids":"string"}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters​
Body​
name | type | description |
---|---|---|
currency | string | - |
end_date | string | - |
group_ids | string | - |
resolution | string | - |
rounding | integer | - |
rounding_minutes | integer | - |
start_date | string | - |
user_ids | string | - |
Response​
200​
A stream with the csv or xlsx for the report being exported
400​
Invalid parameters
403​
User has no access to workspace or is not admin
500​
Internal Server Error
POST Export profitability project insights​
https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/profitability/projects.{extension}
Downloads profitability project insights in the specified format: csv or xlsx.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/profitability/projects.{extension} \
-H "Content-Type: application/json" \
-d '{"billable":"boolean","client_ids":["integer"],"currency":"string","end_date":"string","project_ids":["integer"],"resolution":"string","rounding":"integer","rounding_minutes":"integer","start_date":"string"}' \
-u <email>:<password>
bytes, err := json.Marshal('{"billable":"boolean","client_ids":["integer"],"currency":"string","end_date":"string","project_ids":["integer"],"resolution":"string","rounding":"integer","rounding_minutes":"integer","start_date":"string"}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/profitability/projects.{extension}", bytes.NewBuffer(bytes))
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/profitability/projects.{extension}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
req.body = {"billable":"boolean","client_ids":["integer"],"currency":"string","end_date":"string","project_ids":["integer"],"resolution":"string","rounding":"integer","rounding_minutes":"integer","start_date":"string"}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/profitability/projects.{extension}", {
method: "POST",
body: {"billable":"boolean","client_ids":["integer"],"currency":"string","end_date":"string","project_ids":["integer"],"resolution":"string","rounding":"integer","rounding_minutes":"integer","start_date":"string"},
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${base64.encode(<email>:<password>)}`
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.post('https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/profitability/projects.{extension}', json={"billable":"boolean","client_ids":["integer"],"currency":"string","end_date":"string","project_ids":["integer"],"resolution":"string","rounding":"integer","rounding_minutes":"integer","start_date":"string"}, headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' % b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
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::POST, "https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/profitability/projects.{extension}".to_string())
.json(&serde_json::json!({"billable":"boolean","client_ids":["integer"],"currency":"string","end_date":"string","project_ids":["integer"],"resolution":"string","rounding":"integer","rounding_minutes":"integer","start_date":"string"}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters​
Path​
name | type | required | description |
---|---|---|---|
extension | string | true | csv,xlsx |
Body​
name | type | description |
---|---|---|
billable | boolean | Whether the project is set as billable, optional, premium feature. |
client_ids | Array of integer | Client IDs, optional. A nil entry on this list means that only projects without client will be selected. |
currency | string | Currency, example: "usd". |
end_date | string | End date, optional, example: time.DateOnly. Should be greater than Start date. |
project_ids | Array of integer | Project IDS, optional. |
resolution | string | Resolution, optional. Can be "day", "week" or "month". |
rounding | integer | Rounding, optional, duration rounding settings, premium feature. |
rounding_minutes | integer | RoundingMinutes, optional, duration rounding minutes settings, premium feature. |
start_date | string | Start date, optional, example: time.DateOnly. Should be less than End date. |
Response​
200​
A stream with the csv or xlsx for the report being exported
400​
Possible error messages:
* Invalid parameters
* Invalid workspace ID
403​
User has no access to workspace or is not admin
500​
Internal Server Error
POST Export projects data trends​
https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/trends/projects.{extension}
Downloads projects data trends in the specified format: csv or xlsx.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/trends/projects.{extension} \
-H "Content-Type: application/json" \
-d '{"billable":"boolean","end_date":"string","previous_period_start":"string","project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","start_date":"string"}' \
-u <email>:<password>
bytes, err := json.Marshal('{"billable":"boolean","end_date":"string","previous_period_start":"string","project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","start_date":"string"}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/trends/projects.{extension}", bytes.NewBuffer(bytes))
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/trends/projects.{extension}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
req.body = {"billable":"boolean","end_date":"string","previous_period_start":"string","project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","start_date":"string"}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/trends/projects.{extension}", {
method: "POST",
body: {"billable":"boolean","end_date":"string","previous_period_start":"string","project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","start_date":"string"},
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${base64.encode(<email>:<password>)}`
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.post('https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/trends/projects.{extension}', json={"billable":"boolean","end_date":"string","previous_period_start":"string","project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","start_date":"string"}, headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' % b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
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::POST, "https://api.track.toggl.com/insights/api/v1/workspace/{workspace_id}/trends/projects.{extension}".to_string())
.json(&serde_json::json!({"billable":"boolean","end_date":"string","previous_period_start":"string","project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","start_date":"string"}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters​
Path​
name | type | required | description |
---|---|---|---|
workspace_id | integer | true | Workspace ID |
extension | string | true | csv,xlsx |
Body​
name | type | description |
---|---|---|
billable | boolean | Whether the project is set as billable, optional, premium feature. |
end_date | string | End date, example time.DateOnly. Should be greater than Start date. |
previous_period_start | string | Previous start date, example time.DateOnly. |
project_ids | Array of integer | Project IDs, optional. |
rounding | integer | Rounding, optional, duration rounding settings, premium feature. |
rounding_minutes | integer | RoundingMinutes, optional, duration rounding minutes settings, premium feature. |
start_date | string | Start date, example time.DateOnly. Should be less than End date. |
Response​
200​
Returns data projects data trends
Array of:
name | type | description |
---|---|---|
current_period_seconds | Array of integer | - |
previous_period_seconds | Array of integer | - |
project_id | integer | - |
start | string | - |
user_ids | Array of integer | - |
400​
Possible error messages:
* At least one parameter must be set
* Invalid workspace id
* wrong format date
* start should come after end
403​
Possible error messages:
* Workspace not found/accessible"
* user has no required access to asked workspace
500​
Internal Server Error
POST Export CSV for saved report​
https://api.track.toggl.com/reports/api/v3/shared/{report_token}.csv
Downloads a previously saved report in csv.
Authentication
A public report is accessible by anyone, a private one is only accessible by the report's owner or workspace admin. If the criteria aren't met it returns 403 status code.
Parameters
The report can be executed without parameters, and in this case the saved or default parameters will be used.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://api.track.toggl.com/reports/api/v3/shared/{report_token}.csv \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodPost,
"https://api.track.toggl.com/reports/api/v3/shared/{report_token}.csv")
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/reports/api/v3/shared/{report_token}.csv')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/reports/api/v3/shared/{report_token}.csv", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${base64.encode(<email>:<password>)}`
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.post('https://api.track.toggl.com/reports/api/v3/shared/{report_token}.csv', headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' % b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
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::POST, "https://api.track.toggl.com/reports/api/v3/shared/{report_token}.csv".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Response​
200​
Returns report information in csv form
400​
Possible error messages:
* report_type does not exist in params
* The report period is not supported
401​
Possible error messages:
* Unable to extract authentication data
* Incorrect username and/or password
403​
Possible error messages:
* Invalid token
* Workspace was not found or the report's owner is no longer active on it
404​
Not found
500​
parameter \`since\` is missing
POST Export XSLX saved report​
https://api.track.toggl.com/reports/api/v3/shared/{report_token}.xlsx
Downloads a previously saved report in xlsx.
Authentication
A public report is accessible by anyone, a private one is only accessible by the report's owner or workspace admin. If the criteria aren't met it returns 403 status code.
Parameters
The report can be executed without parameters, and in this case the saved or default parameters will be used.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://api.track.toggl.com/reports/api/v3/shared/{report_token}.xlsx \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodPost,
"https://api.track.toggl.com/reports/api/v3/shared/{report_token}.xlsx")
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/reports/api/v3/shared/{report_token}.xlsx')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/reports/api/v3/shared/{report_token}.xlsx", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${base64.encode(<email>:<password>)}`
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.post('https://api.track.toggl.com/reports/api/v3/shared/{report_token}.xlsx', headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' % b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
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::POST, "https://api.track.toggl.com/reports/api/v3/shared/{report_token}.xlsx".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Response​
200​
Returns report information in xlsx form
400​
Possible error messages:
* report_type does not exist in params
* The report period is not supported
401​
Possible error messages:
* Unable to extract authentication data
* Incorrect username and/or password
403​
Possible error messages:
* Invalid token
* Workspace was not found or the report's owner is no longer active on it
404​
Not found
500​
parameter \`since\` is missing
POST Export saved report in pdf format​
https://api.track.toggl.com/reports/api/v3/shared/{report_token}/pdf
Authentication
A public report is accessible by anyone, a private one is only accessible by the report's owner or workspace admin. If the criteria aren't met it returns 403 status code.
Parameters
The report can be executed without parameters, and in this case the saved or default parameters will be used.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://api.track.toggl.com/reports/api/v3/shared/{report_token}/pdf \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodPost,
"https://api.track.toggl.com/reports/api/v3/shared/{report_token}/pdf")
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/reports/api/v3/shared/{report_token}/pdf')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/reports/api/v3/shared/{report_token}/pdf", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${base64.encode(<email>:<password>)}`
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.post('https://api.track.toggl.com/reports/api/v3/shared/{report_token}/pdf', headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' % b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
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::POST, "https://api.track.toggl.com/reports/api/v3/shared/{report_token}/pdf".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Response​
200​
Returns report information in pdf form
400​
Possible error messages:
* report_type does not exist in params
* The report period is not supported
401​
Possible error messages:
* Unable to extract authentication data
* Incorrect username and/or password
403​
Possible error messages:
* Invalid token
* Workspace was not found or the report's owner is no longer active on it
404​
Not found
500​
parameter \`since\` is missing
POST Export detailed report​
https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries.pdf
Downloads detailed report in pdf format.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries.pdf \
-H "Content-Type: application/json" \
-d '{"billable":"boolean","cents_separator":"string","client_ids":["integer"],"date_format":"string","description":"string","display_mode":"string","duration_format":"string","end_date":"string","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":["integer"],"grouped":"boolean","hide_amounts":"boolean","hour_format":"string","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}' \
-u <email>:<password>
bytes, err := json.Marshal('{"billable":"boolean","cents_separator":"string","client_ids":["integer"],"date_format":"string","description":"string","display_mode":"string","duration_format":"string","end_date":"string","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":["integer"],"grouped":"boolean","hide_amounts":"boolean","hour_format":"string","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries.pdf", bytes.NewBuffer(bytes))
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries.pdf')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
req.body = {"billable":"boolean","cents_separator":"string","client_ids":["integer"],"date_format":"string","description":"string","display_mode":"string","duration_format":"string","end_date":"string","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":["integer"],"grouped":"boolean","hide_amounts":"boolean","hour_format":"string","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries.pdf", {
method: "POST",
body: {"billable":"boolean","cents_separator":"string","client_ids":["integer"],"date_format":"string","description":"string","display_mode":"string","duration_format":"string","end_date":"string","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":["integer"],"grouped":"boolean","hide_amounts":"boolean","hour_format":"string","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]},
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${base64.encode(<email>:<password>)}`
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.post('https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries.pdf', json={"billable":"boolean","cents_separator":"string","client_ids":["integer"],"date_format":"string","description":"string","display_mode":"string","duration_format":"string","end_date":"string","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":["integer"],"grouped":"boolean","hide_amounts":"boolean","hour_format":"string","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}, headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' % b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
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::POST, "https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries.pdf".to_string())
.json(&serde_json::json!({"billable":"boolean","cents_separator":"string","client_ids":["integer"],"date_format":"string","description":"string","display_mode":"string","duration_format":"string","end_date":"string","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":["integer"],"grouped":"boolean","hide_amounts":"boolean","hour_format":"string","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters​
Path​
name | type | required | description |
---|---|---|---|
workspace_id | integer | true | Workspace ID |
Body​
name | type | description |
---|---|---|
billable | boolean | Whether the time entry is set as billable, optional, premium feature. |
cents_separator | string | - |
client_ids | Array of integer | Client IDs, optional, filtering attribute. To filter records with no clients, use [null]. |
date_format | string | - |
description | string | Description, optional, filtering attribute. |
display_mode | string | - |
duration_format | string | Duration format, optional, default "classic". Can be "classic", "decimal" or "improved". |
end_date | string | End date, example time.DateOnly. Should be greater than Start date. |
first_id | integer | - |
first_row_number | integer | - |
first_timestamp | integer | - |
group_ids | Array of integer | Group IDs, optional, filtering attribute. |
grouped | boolean | Whether time entries should be grouped, optional, default false. |
hide_amounts | boolean | Whether amounts should be hidden, optional, default false. |
hour_format | string | - |
max_duration_seconds | integer | Max duration seconds, optional, filtering attribute. Time Audit only, should be greater than MinDurationSeconds. |
min_duration_seconds | integer | Min duration seconds, optional, filtering attribute. Time Audit only, should be less than MaxDurationSeconds. |
order_by | string | Order by field, optional, default "date". Can be "date", "user", "duration", "description" or "last_update". |
order_dir | string | Order direction, optional. Can be ASC or DESC. |
page_size | integer | PageSize defines the number of items per page, optional, default 50. |
postedFields | Array of string | - |
project_ids | Array of integer | Project IDs, optional, filtering attribute. To filter records with no projects, use [null]. |
rounding | integer | Whether time should be rounded, optional, default from workspace settings. |
rounding_minutes | integer | Rounding minutes value, optional, default from workspace settings. Should be 0, 1, 5, 6, 10, 12, 15, 30, 60 or 240. |
startTime | string | - |
start_date | string | Start date, example time.DateOnly. Should be less than End date. |
tag_ids | Array of integer | Tag IDs, optional, filtering attribute. To filter records with no tags, use [null]. |
task_ids | Array of integer | Task IDs, optional, filtering attribute. To filter records with no tasks, use [null]. |
time_entry_ids | Array of integer | TimeEntryIDs filters by time entries. This was added to support retro-compatibility with reports v2. |
user_ids | Array of integer | User IDs, optional, filtering attribute. |
Response​
200​
Returns the detailed report in pdf format
400​
Possible error messages:
* At least one parameter must be set
* Invalid workspace id
* Invalid '{parameter}' value, allowed values are: '{valid_values}'
402​
Workspace needs to have this feature enabled
403​
Workspace not found/accessible
500​
Internal Server Error
POST Export detailed report​
https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries.{extension}
Downloads detailed report in the specified format: csv or xlsx.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries.{extension} \
-H "Content-Type: application/json" \
-d '{"billable":"boolean","client_ids":["integer"],"description":"string","duration_format":"string","end_date":"string","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":["integer"],"grouped":"boolean","hide_amounts":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}' \
-u <email>:<password>
bytes, err := json.Marshal('{"billable":"boolean","client_ids":["integer"],"description":"string","duration_format":"string","end_date":"string","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":["integer"],"grouped":"boolean","hide_amounts":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries.{extension}", bytes.NewBuffer(bytes))
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries.{extension}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
req.body = {"billable":"boolean","client_ids":["integer"],"description":"string","duration_format":"string","end_date":"string","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":["integer"],"grouped":"boolean","hide_amounts":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries.{extension}", {
method: "POST",
body: {"billable":"boolean","client_ids":["integer"],"description":"string","duration_format":"string","end_date":"string","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":["integer"],"grouped":"boolean","hide_amounts":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]},
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${base64.encode(<email>:<password>)}`
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.post('https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries.{extension}', json={"billable":"boolean","client_ids":["integer"],"description":"string","duration_format":"string","end_date":"string","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":["integer"],"grouped":"boolean","hide_amounts":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}, headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' % b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
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::POST, "https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/search/time_entries.{extension}".to_string())
.json(&serde_json::json!({"billable":"boolean","client_ids":["integer"],"description":"string","duration_format":"string","end_date":"string","first_id":"integer","first_row_number":"integer","first_timestamp":"integer","group_ids":["integer"],"grouped":"boolean","hide_amounts":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","page_size":"integer","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters​
Path​
name | type | required | description |
---|---|---|---|
workspace_id | integer | true | Workspace ID |
extension | string | true | csv,xlsx |
Body​
name | type | description |
---|---|---|
billable | boolean | Whether the time entry is set as billable, optional, premium feature. |
client_ids | Array of integer | Client IDs, optional, filtering attribute. To filter records with no clients, use [null]. |
description | string | Description, optional, filtering attribute. |
duration_format | string | Duration format, optional, default "classic". Can be "classic", "decimal" or "improved". |
end_date | string | End date, example time.DateOnly. Should be greater than Start date. |
first_id | integer | - |
first_row_number | integer | - |
first_timestamp | integer | - |
group_ids | Array of integer | Group IDs, optional, filtering attribute. |
grouped | boolean | Whether time entries should be grouped, optional, default false. |
hide_amounts | boolean | Whether amounts should be hidden, optional, default false. |
max_duration_seconds | integer | Max duration seconds, optional, filtering attribute. Time Audit only, should be greater than MinDurationSeconds. |
min_duration_seconds | integer | Min duration seconds, optional, filtering attribute. Time Audit only, should be less than MaxDurationSeconds. |
order_by | string | Order by field, optional, default "date". Can be "date", "user", "duration", "description" or "last_update". |
order_dir | string | Order direction, optional. Can be ASC or DESC. |
page_size | integer | PageSize defines the number of items per page, optional, default 50. |
postedFields | Array of string | - |
project_ids | Array of integer | Project IDs, optional, filtering attribute. To filter records with no projects, use [null]. |
rounding | integer | Whether time should be rounded, optional, default from workspace settings. |
rounding_minutes | integer | Rounding minutes value, optional, default from workspace settings. Should be 0, 1, 5, 6, 10, 12, 15, 30, 60 or 240. |
startTime | string | - |
start_date | string | Start date, example time.DateOnly. Should be less than End date. |
tag_ids | Array of integer | Tag IDs, optional, filtering attribute. To filter records with no tags, use [null]. |
task_ids | Array of integer | Task IDs, optional, filtering attribute. To filter records with no tasks, use [null]. |
time_entry_ids | Array of integer | TimeEntryIDs filters by time entries. This was added to support retro-compatibility with reports v2. |
user_ids | Array of integer | User IDs, optional, filtering attribute. |
Response​
200​
Returns the detailed report in the specified format: csv or xlsx
400​
Possible error messages:
* At least one parameter must be set
* Invalid workspace id
* Invalid '{parameter}' value, allowed values are: '{valid_values}'
402​
Workspace needs to have this feature enabled
403​
Workspace not found/accessible
500​
Internal Server Error
POST Export summary report​
https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/summary/time_entries.pdf
Downloads summary report in pdf format.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/summary/time_entries.pdf \
-H "Content-Type: application/json" \
-d '{"audit":{"group_filter":{"currency":"string","max_amount_cents":"integer","max_duration_seconds":"integer","min_amount_cents":"integer","min_duration_seconds":"integer"},"show_empty_groups":"boolean","show_tracked_groups":"boolean"},"billable":"boolean","cents_separator":"string","client_ids":["integer"],"collapse":"boolean","date_format":"string","description":"string","distinguish_rates":"boolean","duration_format":"string","end_date":"string","group_ids":["integer"],"grouping":"string","hide_amounts":"boolean","hide_rates":"boolean","include_time_entry_ids":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","postedFields":["string"],"project_ids":["integer"],"resolution":"string","rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","sub_grouping":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}' \
-u <email>:<password>
bytes, err := json.Marshal('{"audit":{"group_filter":{"currency":"string","max_amount_cents":"integer","max_duration_seconds":"integer","min_amount_cents":"integer","min_duration_seconds":"integer"},"show_empty_groups":"boolean","show_tracked_groups":"boolean"},"billable":"boolean","cents_separator":"string","client_ids":["integer"],"collapse":"boolean","date_format":"string","description":"string","distinguish_rates":"boolean","duration_format":"string","end_date":"string","group_ids":["integer"],"grouping":"string","hide_amounts":"boolean","hide_rates":"boolean","include_time_entry_ids":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","postedFields":["string"],"project_ids":["integer"],"resolution":"string","rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","sub_grouping":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/summary/time_entries.pdf", bytes.NewBuffer(bytes))
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/summary/time_entries.pdf')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
req.body = {"audit":{"group_filter":{"currency":"string","max_amount_cents":"integer","max_duration_seconds":"integer","min_amount_cents":"integer","min_duration_seconds":"integer"},"show_empty_groups":"boolean","show_tracked_groups":"boolean"},"billable":"boolean","cents_separator":"string","client_ids":["integer"],"collapse":"boolean","date_format":"string","description":"string","distinguish_rates":"boolean","duration_format":"string","end_date":"string","group_ids":["integer"],"grouping":"string","hide_amounts":"boolean","hide_rates":"boolean","include_time_entry_ids":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","postedFields":["string"],"project_ids":["integer"],"resolution":"string","rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","sub_grouping":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/summary/time_entries.pdf", {
method: "POST",
body: {"audit":{"group_filter":{"currency":"string","max_amount_cents":"integer","max_duration_seconds":"integer","min_amount_cents":"integer","min_duration_seconds":"integer"},"show_empty_groups":"boolean","show_tracked_groups":"boolean"},"billable":"boolean","cents_separator":"string","client_ids":["integer"],"collapse":"boolean","date_format":"string","description":"string","distinguish_rates":"boolean","duration_format":"string","end_date":"string","group_ids":["integer"],"grouping":"string","hide_amounts":"boolean","hide_rates":"boolean","include_time_entry_ids":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","postedFields":["string"],"project_ids":["integer"],"resolution":"string","rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","sub_grouping":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]},
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${base64.encode(<email>:<password>)}`
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.post('https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/summary/time_entries.pdf', json={"audit":{"group_filter":{"currency":"string","max_amount_cents":"integer","max_duration_seconds":"integer","min_amount_cents":"integer","min_duration_seconds":"integer"},"show_empty_groups":"boolean","show_tracked_groups":"boolean"},"billable":"boolean","cents_separator":"string","client_ids":["integer"],"collapse":"boolean","date_format":"string","description":"string","distinguish_rates":"boolean","duration_format":"string","end_date":"string","group_ids":["integer"],"grouping":"string","hide_amounts":"boolean","hide_rates":"boolean","include_time_entry_ids":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","postedFields":["string"],"project_ids":["integer"],"resolution":"string","rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","sub_grouping":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}, headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' % b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
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::POST, "https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/summary/time_entries.pdf".to_string())
.json(&serde_json::json!({"audit":{"group_filter":{"currency":"string","max_amount_cents":"integer","max_duration_seconds":"integer","min_amount_cents":"integer","min_duration_seconds":"integer"},"show_empty_groups":"boolean","show_tracked_groups":"boolean"},"billable":"boolean","cents_separator":"string","client_ids":["integer"],"collapse":"boolean","date_format":"string","description":"string","distinguish_rates":"boolean","duration_format":"string","end_date":"string","group_ids":["integer"],"grouping":"string","hide_amounts":"boolean","hide_rates":"boolean","include_time_entry_ids":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","postedFields":["string"],"project_ids":["integer"],"resolution":"string","rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","sub_grouping":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters​
Path​
name | type | required | description |
---|---|---|---|
workspace_id | integer | true | Workspace ID |
Body​
name | type | description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
audit |
| - | ||||||||||||||||||||||||||||||
billable | boolean | Whether the time entry is set as billable, optional, premium feature. | ||||||||||||||||||||||||||||||
cents_separator | string | - | ||||||||||||||||||||||||||||||
client_ids | Array of integer | Client IDs, optional, filtering attribute. To filter records with no clients, use [null]. | ||||||||||||||||||||||||||||||
collapse | boolean | Whether collapse others, optional, default false. | ||||||||||||||||||||||||||||||
date_format | string | Date format, optional, default "MM/DD/YYYY". Can be "MM/DD/YYYY", "DD-MM-YYYY", "MM-DD-YYYY", "YYYY-MM-DD", "DD/MM/YYYY" or "DD.MM.YYYY". | ||||||||||||||||||||||||||||||
description | string | Description, optional, filtering attribute. | ||||||||||||||||||||||||||||||
distinguish_rates | boolean | DistinguishRates will create new subgroups for each rate, optional, default false. | ||||||||||||||||||||||||||||||
duration_format | string | Duration format, optional, default "classic". Can be "classic", "decimal" or "improved". | ||||||||||||||||||||||||||||||
end_date | string | End date, example time.DateOnly. Should be greater than Start date. | ||||||||||||||||||||||||||||||
group_ids | Array of integer | Group IDs, optional, filtering attribute. | ||||||||||||||||||||||||||||||
grouping | string | Grouping option, optional. | ||||||||||||||||||||||||||||||
hide_amounts | boolean | Whether amounts should be hidden, optional, default false. | ||||||||||||||||||||||||||||||
hide_rates | boolean | Whether rates should be hidden, optional, default false. | ||||||||||||||||||||||||||||||
include_time_entry_ids | boolean | Whether time entry IDs should be included in the results, optional, default false. Not applicable for export. | ||||||||||||||||||||||||||||||
max_duration_seconds | integer | Max duration seconds, optional, filtering attribute. Time Audit only, should be greater than MinDurationSeconds. | ||||||||||||||||||||||||||||||
min_duration_seconds | integer | Min duration seconds, optional, filtering attribute. Time Audit only, should be less than MaxDurationSeconds. | ||||||||||||||||||||||||||||||
order_by | string | Order by option, optional, default title. Can be title or duration. | ||||||||||||||||||||||||||||||
order_dir | string | Order direction, optional. Can be ASC or DESC. | ||||||||||||||||||||||||||||||
postedFields | Array of string | - | ||||||||||||||||||||||||||||||
project_ids | Array of integer | Project IDs, optional, filtering attribute. To filter records with no projects, use [null]. | ||||||||||||||||||||||||||||||
resolution | string | Graph resolution, optional. Allow clients to explicitly request a resolution. | ||||||||||||||||||||||||||||||
rounding | integer | Whether time should be rounded, optional, default from workspace settings. | ||||||||||||||||||||||||||||||
rounding_minutes | integer | Rounding minutes value, optional, default from workspace settings. Should be 0, 1, 5, 6, 10, 12, 15, 30, 60 or 240. | ||||||||||||||||||||||||||||||
startTime | string | - | ||||||||||||||||||||||||||||||
start_date | string | Start date, example time.DateOnly. Should be less than End date. | ||||||||||||||||||||||||||||||
sub_grouping | string | SubGrouping option, optional. | ||||||||||||||||||||||||||||||
tag_ids | Array of integer | Tag IDs, optional, filtering attribute. To filter records with no tags, use [null]. | ||||||||||||||||||||||||||||||
task_ids | Array of integer | Task IDs, optional, filtering attribute. To filter records with no tasks, use [null]. | ||||||||||||||||||||||||||||||
time_entry_ids | Array of integer | TimeEntryIDs filters by time entries. This was added to support retro-compatibility with reports v2. | ||||||||||||||||||||||||||||||
user_ids | Array of integer | User IDs, optional, filtering attribute. |
Response​
200​
Returns the summary report in pdf format
400​
Possible error messages:
* At least one parameter must be set
* Invalid workspace id
* Invalid '{parameter}' value, allowed values are: '{valid_values}'
402​
Workspace needs to have this feature enabled
403​
Workspace not found/accessible
500​
Internal Server Error
POST Export summary report​
https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/summary/time_entries.{extension}
Downloads summary report in the specified in the specified format: csv or xlsx.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/summary/time_entries.{extension} \
-H "Content-Type: application/json" \
-d '{"audit":{"group_filter":{"currency":"string","max_amount_cents":"integer","max_duration_seconds":"integer","min_amount_cents":"integer","min_duration_seconds":"integer"},"show_empty_groups":"boolean","show_tracked_groups":"boolean"},"billable":"boolean","client_ids":["integer"],"collapse":"boolean","description":"string","distinguish_rates":"boolean","duration_format":"string","end_date":"string","group_ids":["integer"],"grouping":"string","hide_amounts":"boolean","hide_rates":"boolean","include_time_entry_ids":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","sub_grouping":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}' \
-u <email>:<password>
bytes, err := json.Marshal('{"audit":{"group_filter":{"currency":"string","max_amount_cents":"integer","max_duration_seconds":"integer","min_amount_cents":"integer","min_duration_seconds":"integer"},"show_empty_groups":"boolean","show_tracked_groups":"boolean"},"billable":"boolean","client_ids":["integer"],"collapse":"boolean","description":"string","distinguish_rates":"boolean","duration_format":"string","end_date":"string","group_ids":["integer"],"grouping":"string","hide_amounts":"boolean","hide_rates":"boolean","include_time_entry_ids":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","sub_grouping":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/summary/time_entries.{extension}", bytes.NewBuffer(bytes))
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/summary/time_entries.{extension}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
req.body = {"audit":{"group_filter":{"currency":"string","max_amount_cents":"integer","max_duration_seconds":"integer","min_amount_cents":"integer","min_duration_seconds":"integer"},"show_empty_groups":"boolean","show_tracked_groups":"boolean"},"billable":"boolean","client_ids":["integer"],"collapse":"boolean","description":"string","distinguish_rates":"boolean","duration_format":"string","end_date":"string","group_ids":["integer"],"grouping":"string","hide_amounts":"boolean","hide_rates":"boolean","include_time_entry_ids":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","sub_grouping":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/summary/time_entries.{extension}", {
method: "POST",
body: {"audit":{"group_filter":{"currency":"string","max_amount_cents":"integer","max_duration_seconds":"integer","min_amount_cents":"integer","min_duration_seconds":"integer"},"show_empty_groups":"boolean","show_tracked_groups":"boolean"},"billable":"boolean","client_ids":["integer"],"collapse":"boolean","description":"string","distinguish_rates":"boolean","duration_format":"string","end_date":"string","group_ids":["integer"],"grouping":"string","hide_amounts":"boolean","hide_rates":"boolean","include_time_entry_ids":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","sub_grouping":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]},
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${base64.encode(<email>:<password>)}`
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.post('https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/summary/time_entries.{extension}', json={"audit":{"group_filter":{"currency":"string","max_amount_cents":"integer","max_duration_seconds":"integer","min_amount_cents":"integer","min_duration_seconds":"integer"},"show_empty_groups":"boolean","show_tracked_groups":"boolean"},"billable":"boolean","client_ids":["integer"],"collapse":"boolean","description":"string","distinguish_rates":"boolean","duration_format":"string","end_date":"string","group_ids":["integer"],"grouping":"string","hide_amounts":"boolean","hide_rates":"boolean","include_time_entry_ids":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","sub_grouping":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}, headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' % b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
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::POST, "https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/summary/time_entries.{extension}".to_string())
.json(&serde_json::json!({"audit":{"group_filter":{"currency":"string","max_amount_cents":"integer","max_duration_seconds":"integer","min_amount_cents":"integer","min_duration_seconds":"integer"},"show_empty_groups":"boolean","show_tracked_groups":"boolean"},"billable":"boolean","client_ids":["integer"],"collapse":"boolean","description":"string","distinguish_rates":"boolean","duration_format":"string","end_date":"string","group_ids":["integer"],"grouping":"string","hide_amounts":"boolean","hide_rates":"boolean","include_time_entry_ids":"boolean","max_duration_seconds":"integer","min_duration_seconds":"integer","order_by":"string","order_dir":"string","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","sub_grouping":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters​
Path​
name | type | required | description |
---|---|---|---|
workspace_id | integer | true | Workspace ID |
extension | string | true | csv,xlsx |
Body​
name | type | description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
audit |
| - | ||||||||||||||||||||||||||||||
billable | boolean | Whether the time entry is set as billable, optional, premium feature. | ||||||||||||||||||||||||||||||
client_ids | Array of integer | Client IDs, optional, filtering attribute. To filter records with no clients, use [null]. | ||||||||||||||||||||||||||||||
collapse | boolean | Whether collapse others, optional, default false. | ||||||||||||||||||||||||||||||
description | string | Description, optional, filtering attribute. | ||||||||||||||||||||||||||||||
distinguish_rates | boolean | DistinguishRates will create new subgroups for each rate, optional, default false. | ||||||||||||||||||||||||||||||
duration_format | string | Duration format, optional, default "classic". Can be "classic", "decimal" or "improved". | ||||||||||||||||||||||||||||||
end_date | string | End date, example time.DateOnly. Should be greater than Start date. | ||||||||||||||||||||||||||||||
group_ids | Array of integer | Group IDs, optional, filtering attribute. | ||||||||||||||||||||||||||||||
grouping | string | Grouping option, optional. | ||||||||||||||||||||||||||||||
hide_amounts | boolean | Whether amounts should be hidden, optional, default false. | ||||||||||||||||||||||||||||||
hide_rates | boolean | Whether rates should be hidden, optional, default false. | ||||||||||||||||||||||||||||||
include_time_entry_ids | boolean | Whether time entry IDs should be included in the results, optional, default false. Not applicable for export. | ||||||||||||||||||||||||||||||
max_duration_seconds | integer | Max duration seconds, optional, filtering attribute. Time Audit only, should be greater than MinDurationSeconds. | ||||||||||||||||||||||||||||||
min_duration_seconds | integer | Min duration seconds, optional, filtering attribute. Time Audit only, should be less than MaxDurationSeconds. | ||||||||||||||||||||||||||||||
order_by | string | Order by option, optional, default title. Can be title or duration. | ||||||||||||||||||||||||||||||
order_dir | string | Order direction, optional. Can be ASC or DESC. | ||||||||||||||||||||||||||||||
postedFields | Array of string | - | ||||||||||||||||||||||||||||||
project_ids | Array of integer | Project IDs, optional, filtering attribute. To filter records with no projects, use [null]. | ||||||||||||||||||||||||||||||
rounding | integer | Whether time should be rounded, optional, default from workspace settings. | ||||||||||||||||||||||||||||||
rounding_minutes | integer | Rounding minutes value, optional, default from workspace settings. Should be 0, 1, 5, 6, 10, 12, 15, 30, 60 or 240. | ||||||||||||||||||||||||||||||
startTime | string | - | ||||||||||||||||||||||||||||||
start_date | string | Start date, example time.DateOnly. Should be less than End date. | ||||||||||||||||||||||||||||||
sub_grouping | string | SubGrouping option, optional. | ||||||||||||||||||||||||||||||
tag_ids | Array of integer | Tag IDs, optional, filtering attribute. To filter records with no tags, use [null]. | ||||||||||||||||||||||||||||||
task_ids | Array of integer | Task IDs, optional, filtering attribute. To filter records with no tasks, use [null]. | ||||||||||||||||||||||||||||||
time_entry_ids | Array of integer | TimeEntryIDs filters by time entries. This was added to support retro-compatibility with reports v2. | ||||||||||||||||||||||||||||||
user_ids | Array of integer | User IDs, optional, filtering attribute. |
Response​
200​
Returns the summary report on the specified format: csv or xlsx
400​
Possible error messages:
* At least one parameter must be set
* Invalid workspace id
* Invalid '{parameter}' value, allowed values are: '{valid_values}'
402​
Workspace needs to have this feature enabled
403​
Workspace not found/accessible
500​
Internal Server Error
POST Export weekly report​
https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/weekly/time_entries.csv
Downloads weekly report in csv format.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/weekly/time_entries.csv \
-H "Content-Type: application/json" \
-d '{"billable":"boolean","calculate":"string","client_ids":["integer"],"description":"string","end_date":"string","group_by_task":"boolean","group_ids":["integer"],"grouping":"string","max_duration_seconds":"integer","min_duration_seconds":"integer","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}' \
-u <email>:<password>
bytes, err := json.Marshal('{"billable":"boolean","calculate":"string","client_ids":["integer"],"description":"string","end_date":"string","group_by_task":"boolean","group_ids":["integer"],"grouping":"string","max_duration_seconds":"integer","min_duration_seconds":"integer","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/weekly/time_entries.csv", bytes.NewBuffer(bytes))
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/weekly/time_entries.csv')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
req.body = {"billable":"boolean","calculate":"string","client_ids":["integer"],"description":"string","end_date":"string","group_by_task":"boolean","group_ids":["integer"],"grouping":"string","max_duration_seconds":"integer","min_duration_seconds":"integer","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/weekly/time_entries.csv", {
method: "POST",
body: {"billable":"boolean","calculate":"string","client_ids":["integer"],"description":"string","end_date":"string","group_by_task":"boolean","group_ids":["integer"],"grouping":"string","max_duration_seconds":"integer","min_duration_seconds":"integer","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]},
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${base64.encode(<email>:<password>)}`
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.post('https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/weekly/time_entries.csv', json={"billable":"boolean","calculate":"string","client_ids":["integer"],"description":"string","end_date":"string","group_by_task":"boolean","group_ids":["integer"],"grouping":"string","max_duration_seconds":"integer","min_duration_seconds":"integer","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}, headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' % b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
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::POST, "https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/weekly/time_entries.csv".to_string())
.json(&serde_json::json!({"billable":"boolean","calculate":"string","client_ids":["integer"],"description":"string","end_date":"string","group_by_task":"boolean","group_ids":["integer"],"grouping":"string","max_duration_seconds":"integer","min_duration_seconds":"integer","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters​
Path​
name | type | required | description |
---|---|---|---|
workspace_id | integer | true | Workspace ID |
Body​
name | type | description |
---|---|---|
billable | boolean | Whether the time entry is set as billable, optional, premium feature. |
calculate | string | Calculate option, optional. Can be by time or amounts. |
client_ids | Array of integer | Client IDs, optional, filtering attribute. To filter records with no clients, use [null]. |
description | string | Description, optional, filtering attribute. |
end_date | string | End date, example time.DateOnly. Should be greater than Start date. |
group_by_task | boolean | GroupByTask tells the weekly report to return the data grouped by all the usual groups plus planned task. |
group_ids | Array of integer | Group IDs, optional, filtering attribute. |
grouping | string | Grouping option, optional. |
max_duration_seconds | integer | Max duration seconds, optional, filtering attribute. Time Audit only, should be greater than MinDurationSeconds. |
min_duration_seconds | integer | Min duration seconds, optional, filtering attribute. Time Audit only, should be less than MaxDurationSeconds. |
postedFields | Array of string | - |
project_ids | Array of integer | Project IDs, optional, filtering attribute. To filter records with no projects, use [null]. |
rounding | integer | Whether time should be rounded, optional, default from workspace settings. |
rounding_minutes | integer | Rounding minutes value, optional, default from workspace settings. Should be 0, 1, 5, 6, 10, 12, 15, 30, 60 or 240. |
startTime | string | - |
start_date | string | Start date, example time.DateOnly. Should be less than End date. |
tag_ids | Array of integer | Tag IDs, optional, filtering attribute. To filter records with no tags, use [null]. |
task_ids | Array of integer | Task IDs, optional, filtering attribute. To filter records with no tasks, use [null]. |
time_entry_ids | Array of integer | TimeEntryIDs filters by time entries. This was added to support retro-compatibility with reports v2. |
user_ids | Array of integer | User IDs, optional, filtering attribute. |
Response​
200​
Returns the weekly report in csv format
400​
Possible error messages:
* At least one parameter must be set
* Invalid workspace id
* The '{parameter}' parameter is not supported
* Invalid '{parameter}' value, allowed values are: '{valid_values}'
402​
Workspace needs to have this feature enabled
403​
Workspace not found/accessible
500​
Internal Server Error
POST Export weekly report​
https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/weekly/time_entries.pdf
Downloads weekly report in pdf format.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/weekly/time_entries.pdf \
-H "Content-Type: application/json" \
-d '{"billable":"boolean","calculate":"string","cents_separator":"string","client_ids":["integer"],"date_format":"string","description":"string","duration_format":"string","end_date":"string","group_by_task":"boolean","group_ids":["integer"],"grouping":"string","max_duration_seconds":"integer","min_duration_seconds":"integer","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}' \
-u <email>:<password>
bytes, err := json.Marshal('{"billable":"boolean","calculate":"string","cents_separator":"string","client_ids":["integer"],"date_format":"string","description":"string","duration_format":"string","end_date":"string","group_by_task":"boolean","group_ids":["integer"],"grouping":"string","max_duration_seconds":"integer","min_duration_seconds":"integer","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/weekly/time_entries.pdf", bytes.NewBuffer(bytes))
if err != nil {
print(err)
}
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.SetBasicAuth("<email>", "<password>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
print(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
print(err)
}
fmt.Print(string(body))
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/weekly/time_entries.pdf')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
req.body = {"billable":"boolean","calculate":"string","cents_separator":"string","client_ids":["integer"],"date_format":"string","description":"string","duration_format":"string","end_date":"string","group_by_task":"boolean","group_ids":["integer"],"grouping":"string","max_duration_seconds":"integer","min_duration_seconds":"integer","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/weekly/time_entries.pdf", {
method: "POST",
body: {"billable":"boolean","calculate":"string","cents_separator":"string","client_ids":["integer"],"date_format":"string","description":"string","duration_format":"string","end_date":"string","group_by_task":"boolean","group_ids":["integer"],"grouping":"string","max_duration_seconds":"integer","min_duration_seconds":"integer","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]},
headers: {
"Content-Type": "application/json",
"Authorization": `Basic ${base64.encode(<email>:<password>)}`
},
})
.then((resp) => resp.json())
.then((json) => {
console.log(json);
})
.catch(err => console.error(err));
import requests
from base64 import b64encode
data = requests.post('https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/weekly/time_entries.pdf', json={"billable":"boolean","calculate":"string","cents_separator":"string","client_ids":["integer"],"date_format":"string","description":"string","duration_format":"string","end_date":"string","group_by_task":"boolean","group_ids":["integer"],"grouping":"string","max_duration_seconds":"integer","min_duration_seconds":"integer","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}, headers={'content-type': 'application/json', 'Authorization' : 'Basic %s' % b64encode(b"<email>:<password>").decode("ascii")})
print(data.json())
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::POST, "https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/weekly/time_entries.pdf".to_string())
.json(&serde_json::json!({"billable":"boolean","calculate":"string","cents_separator":"string","client_ids":["integer"],"date_format":"string","description":"string","duration_format":"string","end_date":"string","group_by_task":"boolean","group_ids":["integer"],"grouping":"string","max_duration_seconds":"integer","min_duration_seconds":"integer","postedFields":["string"],"project_ids":["integer"],"rounding":"integer","rounding_minutes":"integer","startTime":"string","start_date":"string","tag_ids":["integer"],"task_ids":["integer"],"time_entry_ids":["integer"],"user_ids":["integer"]}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters​
Path​
name | type | required | description |
---|---|---|---|
workspace_id | integer | true | Workspace ID |
Body​
name | type | description |
---|---|---|
billable | boolean | Whether the time entry is set as billable, optional, premium feature. |
calculate | string | Calculate option, optional. Can be by time or amounts. |
cents_separator | string | - |
client_ids | Array of integer | Client IDs, optional, filtering attribute. To filter records with no clients, use [null]. |
date_format | string | Date format, optional, default "MM/DD/YYYY". Can be "MM/DD/YYYY", "DD-MM-YYYY", "MM-DD-YYYY", "YYYY-MM-DD", "DD/MM/YYYY" or "DD.MM.YYYY". |
description | string | Description, optional, filtering attribute. |
duration_format | string | Duration format, optional, default "classic". Can be "classic", "decimal" or "improved". |
end_date | string | End date, example time.DateOnly. Should be greater than Start date. |
group_by_task | boolean | GroupByTask tells the weekly report to return the data grouped by all the usual groups plus planned task. |
group_ids | Array of integer | Group IDs, optional, filtering attribute. |
grouping | string | Grouping option, optional. |
max_duration_seconds | integer | Max duration seconds, optional, filtering attribute. Time Audit only, should be greater than MinDurationSeconds. |
min_duration_seconds | integer | Min duration seconds, optional, filtering attribute. Time Audit only, should be less than MaxDurationSeconds. |
postedFields | Array of string | - |
project_ids | Array of integer | Project IDs, optional, filtering attribute. To filter records with no projects, use [null]. |
rounding | integer | Whether time should be rounded, optional, default from workspace settings. |
rounding_minutes | integer | Rounding minutes value, optional, default from workspace settings. Should be 0, 1, 5, 6, 10, 12, 15, 30, 60 or 240. |
startTime | string | - |
start_date | string | Start date, example time.DateOnly. Should be less than End date. |
tag_ids | Array of integer | Tag IDs, optional, filtering attribute. To filter records with no tags, use [null]. |
task_ids | Array of integer | Task IDs, optional, filtering attribute. To filter records with no tasks, use [null]. |
time_entry_ids | Array of integer | TimeEntryIDs filters by time entries. This was added to support retro-compatibility with reports v2. |
user_ids | Array of integer | User IDs, optional, filtering attribute. |
Response​
200​
Returns the weekly report in pdf format
400​
Possible error messages:
* At least one parameter must be set
* Invalid workspace id
* The '{parameter}' parameter is not supported
* Invalid '{parameter}' value, allowed values are: '{valid_values}'
402​
Workspace needs to have this feature enabled
403​
Workspace not found/accessible
500​
Internal Server Error