Summary reports
POST List project users
https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/projects/summary
Returns summary user projects.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/projects/summary \
-H "Content-Type: application/json" \
-d '\{"end_date":"string","startTime":"string","start_date":"string"\}' \
-u <email>:<password>
bytes, err := json.Marshal('\{"end_date":"string","startTime":"string","start_date":"string"\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/projects/summary", 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}/projects/summary')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
req.body = \{"end_date":"string","startTime":"string","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/reports/api/v3/workspace/{workspace_id}/projects/summary", {
method: "POST",
body: \{"end_date":"string","startTime":"string","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/reports/api/v3/workspace/{workspace_id}/projects/summary', json=\{"end_date":"string","startTime":"string","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/reports/api/v3/workspace/{workspace_id}/projects/summary".to_string())
.json(&serde_json::json!(\{"end_date":"string","startTime":"string","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 |
Body
Name | Type | Description |
---|---|---|
end_date | string | End date, example time.DateOnly. Should be greater than Start date. |
startTime | string | - |
start_date | string | Start date, example time.DateOnly. Should be less than End date. |
Response
200
Returns summary user projects
Name | Type | Description |
---|---|---|
items | Array of object | - |
items
Name | Type | Description |
---|---|---|
billable_seconds | integer | - |
project_id | integer | - |
tracked_seconds | integer | - |
user_id | integer | - |
400
Possible error messages:
- At least one parameter must be set
- Invalid workspace id
500
Internal Server Error
POST Load project summary
https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/projects/{project_id}/summary
Returns project's summary.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/projects/{project_id}/summary \
-H "Content-Type: application/json" \
-d '\{"end_date":"string","startTime":"string","start_date":"string"\}' \
-u <email>:<password>
bytes, err := json.Marshal('\{"end_date":"string","startTime":"string","start_date":"string"\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://api.track.toggl.com/reports/api/v3/workspace/{workspace_id}/projects/{project_id}/summary", 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}/projects/{project_id}/summary')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
req.body = \{"end_date":"string","startTime":"string","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/reports/api/v3/workspace/{workspace_id}/projects/{project_id}/summary", {
method: "POST",
body: \{"end_date":"string","startTime":"string","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/reports/api/v3/workspace/{workspace_id}/projects/{project_id}/summary', json=\{"end_date":"string","startTime":"string","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/reports/api/v3/workspace/{workspace_id}/projects/{project_id}/summary".to_string())
.json(&serde_json::json!(\{"end_date":"string","startTime":"string","start_date":"string"\}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}