Reports
POST Generate flexible query report
https://focus.toggl.com/api/reports/workspaces/{workspace_id}/query
Executes a flexible query against the analytics database and returns formatted results.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://focus.toggl.com/api/reports/workspaces/{workspace_id}/query \
-H "Content-Type: application/json" \
-d '\{"aggregation_filters":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{\},"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"aggregations":[\{"function":"string","property":"string"\}],"attributes":[\{"property":"string"\}],"filters":[\{"conditions":[\{"conditions":[\{"conditions":[\{"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"groupings":[\{"property":"string","show_empty":"boolean"\}],"limit":"integer","modifiers":\{\},"ordinations":[\{"direction":"string","nulls":"string","property":"string"\}],"pagination":\{"page":"integer","per_page":"integer"\},"period":\{"from":"string","preset":"string","to":"string"\},"transformations":[\{"name":"string","parameters":[\{\}]\}]\}' \
-u <email>:<password>
bytes, err := json.Marshal('\{"aggregation_filters":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{\},"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"aggregations":[\{"function":"string","property":"string"\}],"attributes":[\{"property":"string"\}],"filters":[\{"conditions":[\{"conditions":[\{"conditions":[\{"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"groupings":[\{"property":"string","show_empty":"boolean"\}],"limit":"integer","modifiers":\{\},"ordinations":[\{"direction":"string","nulls":"string","property":"string"\}],"pagination":\{"page":"integer","per_page":"integer"\},"period":\{"from":"string","preset":"string","to":"string"\},"transformations":[\{"name":"string","parameters":[\{\}]\}]\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://focus.toggl.com/api/reports/workspaces/{workspace_id}/query", 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://focus.toggl.com/api/reports/workspaces/{workspace_id}/query')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
req.body = \{"aggregation_filters":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{\},"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"aggregations":[\{"function":"string","property":"string"\}],"attributes":[\{"property":"string"\}],"filters":[\{"conditions":[\{"conditions":[\{"conditions":[\{"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"groupings":[\{"property":"string","show_empty":"boolean"\}],"limit":"integer","modifiers":\{\},"ordinations":[\{"direction":"string","nulls":"string","property":"string"\}],"pagination":\{"page":"integer","per_page":"integer"\},"period":\{"from":"string","preset":"string","to":"string"\},"transformations":[\{"name":"string","parameters":[\{\}]\}]\}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://focus.toggl.com/api/reports/workspaces/{workspace_id}/query", {
method: "POST",
body: \{"aggregation_filters":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{\},"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"aggregations":[\{"function":"string","property":"string"\}],"attributes":[\{"property":"string"\}],"filters":[\{"conditions":[\{"conditions":[\{"conditions":[\{"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"groupings":[\{"property":"string","show_empty":"boolean"\}],"limit":"integer","modifiers":\{\},"ordinations":[\{"direction":"string","nulls":"string","property":"string"\}],"pagination":\{"page":"integer","per_page":"integer"\},"period":\{"from":"string","preset":"string","to":"string"\},"transformations":[\{"name":"string","parameters":[\{\}]\}]\},
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://focus.toggl.com/api/reports/workspaces/{workspace_id}/query', json=\{"aggregation_filters":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{\},"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"aggregations":[\{"function":"string","property":"string"\}],"attributes":[\{"property":"string"\}],"filters":[\{"conditions":[\{"conditions":[\{"conditions":[\{"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"groupings":[\{"property":"string","show_empty":"boolean"\}],"limit":"integer","modifiers":\{\},"ordinations":[\{"direction":"string","nulls":"string","property":"string"\}],"pagination":\{"page":"integer","per_page":"integer"\},"period":\{"from":"string","preset":"string","to":"string"\},"transformations":[\{"name":"string","parameters":[\{\}]\}]\}, 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://focus.toggl.com/api/reports/workspaces/{workspace_id}/query".to_string())
.json(&serde_json::json!(\{"aggregation_filters":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{\},"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"aggregations":[\{"function":"string","property":"string"\}],"attributes":[\{"property":"string"\}],"filters":[\{"conditions":[\{"conditions":[\{"conditions":[\{"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"groupings":[\{"property":"string","show_empty":"boolean"\}],"limit":"integer","modifiers":\{\},"ordinations":[\{"direction":"string","nulls":"string","property":"string"\}],"pagination":\{"page":"integer","per_page":"integer"\},"period":\{"from":"string","preset":"string","to":"string"\},"transformations":[\{"name":"string","parameters":[\{\}]\}]\}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| workspace_id | integer | true | workspace ID |
Query
| name | type | required | description |
|---|---|---|---|
| include_dicts | boolean | false | include dictionary data in response |
Body
| Name | Type | Description |
|---|---|---|
| aggregation_filters | Array of object | - |
| aggregations | Array of object | - |
| attributes | Array of object | - |
| filters | Array of object | - |
| groupings | Array of object | - |
| limit | integer | - |
| modifiers | object | - |
| ordinations | Array of object | - |
| pagination | object | - |
| period | object | - |
| transformations | Array of object | - |
aggregation_filters
| Name | Type | Description |
|---|---|---|
| aggregation | object | - |
| conditions | Array of object | - |
| operator | string | - |
| property | string | - |
| value | object | - |
aggregation
| Name | Type | Description |
|---|---|---|
| function | string | - |
| property | string | - |
conditions
| Name | Type | Description |
|---|---|---|
| aggregation | object | - |
| conditions | Array of object | - |
| operator | string | - |
| property | string | - |
| value | object | - |
aggregation
| Name | Type | Description |
|---|---|---|
| function | string | - |
| property | string | - |
conditions
| Name | Type | Description |
|---|---|---|
| aggregation | object | - |
| conditions | Array of object | - |
| operator | string | - |
| property | string | - |
| value | object | - |
aggregation
| Name | Type | Description |
|---|---|---|
| function | string | - |
| property | string | - |
conditions
| Name | Type | Description |
|---|---|---|
| aggregation | object | - |
| conditions | Array of object | - |
| operator | string | - |
| property | string | - |
| value | object | - |
aggregations
| Name | Type | Description |
|---|---|---|
| function | string | - |
| property | string | - |
attributes
| Name | Type | Description |
|---|---|---|
| property | string | - |
filters
| Name | Type | Description |
|---|---|---|
| conditions | Array of object | - |
| operator | string | - |
| property | string | - |
| value | object | - |
conditions
| Name | Type | Description |
|---|---|---|
| conditions | Array of object | - |
| operator | string | - |
| property | string | - |
| value | object | - |
conditions
| Name | Type | Description |
|---|---|---|
| conditions | Array of object | - |
| operator | string | - |
| property | string | - |
| value | object | - |
conditions
| Name | Type | Description |
|---|---|---|
| conditions | Array of object | - |
| operator | string | - |
| property | string | - |
| value | object | - |
groupings
| Name | Type | Description |
|---|---|---|
| property | string | - |
| show_empty | boolean | - |
modifiers
ordinations
| Name | Type | Description |
|---|---|---|
| direction | string | - |
| nulls | string | - |
| property | string | - |
pagination
| Name | Type | Description |
|---|---|---|
| page | integer | - |
| per_page | integer | - |
period
| Name | Type | Description |
|---|---|---|
| from | string | - |
| preset | string | - |
| to | string | - |
transformations
| Name | Type | Description |
|---|---|---|
| name | string | - |
| parameters | Array of Object | - |
Response
200
Successfully generated report
| Name | Type | Description |
|---|---|---|
| data_hierarchical | object | - |
| data_json_row | Array of object | - |
| data_table | object | - |
| dictionaries | object | - |
| total_count | integer | - |
data_hierarchical
data_json_row
dictionaries
| Name | Type | Description |
|---|---|---|
| clients | object | - |
| groups | object | - |
| projects | object | - |
| status | object | - |
| tags | object | - |
| tasks | object | - |
| users | object | - |
clients
groups
projects
status
tags
tasks
users
400
Invalid request parameters
500
Internal server error
POST Generate dictionary from filters
https://focus.toggl.com/api/reports/workspaces/{workspace_id}/query/dictionary
Generates a dictionary containing task, project, client, and status information based on the provided filters.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://focus.toggl.com/api/reports/workspaces/{workspace_id}/query/dictionary \
-H "Content-Type: application/json" \
-d '[\{"conditions":[\{"conditions":[\{"conditions":[\{"conditions":[\{"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}]' \
-u <email>:<password>
bytes, err := json.Marshal('[\{"conditions":[\{"conditions":[\{"conditions":[\{"conditions":[\{"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}]')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://focus.toggl.com/api/reports/workspaces/{workspace_id}/query/dictionary", 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://focus.toggl.com/api/reports/workspaces/{workspace_id}/query/dictionary')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
req.body = [\{"conditions":[\{"conditions":[\{"conditions":[\{"conditions":[\{"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}].to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://focus.toggl.com/api/reports/workspaces/{workspace_id}/query/dictionary", {
method: "POST",
body: [\{"conditions":[\{"conditions":[\{"conditions":[\{"conditions":[\{"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],
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://focus.toggl.com/api/reports/workspaces/{workspace_id}/query/dictionary', json=[\{"conditions":[\{"conditions":[\{"conditions":[\{"conditions":[\{"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}], 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://focus.toggl.com/api/reports/workspaces/{workspace_id}/query/dictionary".to_string())
.json(&serde_json::json!([\{"conditions":[\{"conditions":[\{"conditions":[\{"conditions":[\{"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}]))
.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 |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| conditions | Array of object | - |
| operator | string | - |
| property | string | - |
| value | object | - |
conditions
| Name | Type | Description |
|---|---|---|
| conditions | Array of object | - |
| operator | string | - |
| property | string | - |
| value | object | - |
conditions
| Name | Type | Description |
|---|---|---|
| conditions | Array of object | - |
| operator | string | - |
| property | string | - |
| value | object | - |
conditions
| Name | Type | Description |
|---|---|---|
| conditions | Array of object | - |
| operator | string | - |
| property | string | - |
| value | object | - |
conditions
| Name | Type | Description |
|---|---|---|
| conditions | Array of object | - |
| operator | string | - |
| property | string | - |
| value | object | - |
Response
200
Successfully generated dictionary
| Name | Type | Description |
|---|---|---|
| clients | object | - |
| groups | object | - |
| projects | object | - |
| status | object | - |
| tags | object | - |
| tasks | object | - |
| users | object | - |
clients
groups
projects
status
tags
tasks
users
400
Invalid request parameters
500
Internal server error
POST Generate workload report
https://focus.toggl.com/api/reports/workspaces/{workspace_id}/workload
Generates a workload report based on the given input. Breakdown reports (grouped by user_account_id) support optional pagination via 'page' and 'per_page'. Paginated response includes 'total_count' with the total number of users matching the filters.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://focus.toggl.com/api/reports/workspaces/{workspace_id}/workload \
-H "Content-Type: application/json" \
-d '\{"aggregation_filters":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{\},"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"aggregations":[\{"function":"string","property":"string"\}],"attributes":[\{"property":"string"\}],"filters":[\{"conditions":[\{"conditions":[\{"conditions":[\{"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"groupings":[\{"property":"string","show_empty":"boolean"\}],"limit":"integer","modifiers":\{\},"ordinations":[\{"direction":"string","nulls":"string","property":"string"\}],"pagination":\{"page":"integer","per_page":"integer"\},"period":\{"from":"string","preset":"string","to":"string"\},"transformations":[\{"name":"string","parameters":[\{\}]\}]\}' \
-u <email>:<password>
bytes, err := json.Marshal('\{"aggregation_filters":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{\},"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"aggregations":[\{"function":"string","property":"string"\}],"attributes":[\{"property":"string"\}],"filters":[\{"conditions":[\{"conditions":[\{"conditions":[\{"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"groupings":[\{"property":"string","show_empty":"boolean"\}],"limit":"integer","modifiers":\{\},"ordinations":[\{"direction":"string","nulls":"string","property":"string"\}],"pagination":\{"page":"integer","per_page":"integer"\},"period":\{"from":"string","preset":"string","to":"string"\},"transformations":[\{"name":"string","parameters":[\{\}]\}]\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://focus.toggl.com/api/reports/workspaces/{workspace_id}/workload", 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://focus.toggl.com/api/reports/workspaces/{workspace_id}/workload')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
req.body = \{"aggregation_filters":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{\},"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"aggregations":[\{"function":"string","property":"string"\}],"attributes":[\{"property":"string"\}],"filters":[\{"conditions":[\{"conditions":[\{"conditions":[\{"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"groupings":[\{"property":"string","show_empty":"boolean"\}],"limit":"integer","modifiers":\{\},"ordinations":[\{"direction":"string","nulls":"string","property":"string"\}],"pagination":\{"page":"integer","per_page":"integer"\},"period":\{"from":"string","preset":"string","to":"string"\},"transformations":[\{"name":"string","parameters":[\{\}]\}]\}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://focus.toggl.com/api/reports/workspaces/{workspace_id}/workload", {
method: "POST",
body: \{"aggregation_filters":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{\},"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"aggregations":[\{"function":"string","property":"string"\}],"attributes":[\{"property":"string"\}],"filters":[\{"conditions":[\{"conditions":[\{"conditions":[\{"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"groupings":[\{"property":"string","show_empty":"boolean"\}],"limit":"integer","modifiers":\{\},"ordinations":[\{"direction":"string","nulls":"string","property":"string"\}],"pagination":\{"page":"integer","per_page":"integer"\},"period":\{"from":"string","preset":"string","to":"string"\},"transformations":[\{"name":"string","parameters":[\{\}]\}]\},
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://focus.toggl.com/api/reports/workspaces/{workspace_id}/workload', json=\{"aggregation_filters":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{\},"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"aggregations":[\{"function":"string","property":"string"\}],"attributes":[\{"property":"string"\}],"filters":[\{"conditions":[\{"conditions":[\{"conditions":[\{"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"groupings":[\{"property":"string","show_empty":"boolean"\}],"limit":"integer","modifiers":\{\},"ordinations":[\{"direction":"string","nulls":"string","property":"string"\}],"pagination":\{"page":"integer","per_page":"integer"\},"period":\{"from":"string","preset":"string","to":"string"\},"transformations":[\{"name":"string","parameters":[\{\}]\}]\}, 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://focus.toggl.com/api/reports/workspaces/{workspace_id}/workload".to_string())
.json(&serde_json::json!(\{"aggregation_filters":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{"function":"string","property":"string"\},"conditions":[\{"aggregation":\{\},"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"aggregations":[\{"function":"string","property":"string"\}],"attributes":[\{"property":"string"\}],"filters":[\{"conditions":[\{"conditions":[\{"conditions":[\{"conditions":[\{\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"operator":"string","property":"string","value":\{\}\}],"groupings":[\{"property":"string","show_empty":"boolean"\}],"limit":"integer","modifiers":\{\},"ordinations":[\{"direction":"string","nulls":"string","property":"string"\}],"pagination":\{"page":"integer","per_page":"integer"\},"period":\{"from":"string","preset":"string","to":"string"\},"transformations":[\{"name":"string","parameters":[\{\}]\}]\}))
.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 |
|---|---|---|
| aggregation_filters | Array of object | - |
| aggregations | Array of object | - |
| attributes | Array of object | - |
| filters | Array of object | - |
| groupings | Array of object | - |
| limit | integer | - |
| modifiers | object | - |
| ordinations | Array of object | - |
| pagination | object | - |
| period | object | - |
| transformations | Array of object | - |
aggregation_filters
| Name | Type | Description |
|---|---|---|
| aggregation | object | - |
| conditions | Array of object | - |
| operator | string | - |
| property | string | - |
| value | object | - |
aggregation
| Name | Type | Description |
|---|---|---|
| function | string | - |
| property | string | - |
conditions
| Name | Type | Description |
|---|---|---|
| aggregation | object | - |
| conditions | Array of object | - |
| operator | string | - |
| property | string | - |
| value | object | - |
aggregation
| Name | Type | Description |
|---|---|---|
| function | string | - |
| property | string | - |
conditions
| Name | Type | Description |
|---|---|---|
| aggregation | object | - |
| conditions | Array of object | - |
| operator | string | - |
| property | string | - |
| value | object | - |
aggregation
| Name | Type | Description |
|---|---|---|
| function | string | - |
| property | string | - |
conditions
| Name | Type | Description |
|---|---|---|
| aggregation | object | - |
| conditions | Array of object | - |
| operator | string | - |
| property | string | - |
| value | object | - |
aggregations
| Name | Type | Description |
|---|---|---|
| function | string | - |
| property | string | - |
attributes
| Name | Type | Description |
|---|---|---|
| property | string | - |
filters
| Name | Type | Description |
|---|---|---|
| conditions | Array of object | - |
| operator | string | - |
| property | string | - |
| value | object | - |
conditions
| Name | Type | Description |
|---|---|---|
| conditions | Array of object | - |
| operator | string | - |
| property | string | - |
| value | object | - |
conditions
| Name | Type | Description |
|---|---|---|
| conditions | Array of object | - |
| operator | string | - |
| property | string | - |
| value | object | - |
conditions
| Name | Type | Description |
|---|---|---|
| conditions | Array of object | - |
| operator | string | - |
| property | string | - |
| value | object | - |
groupings
| Name | Type | Description |
|---|---|---|
| property | string | - |
| show_empty | boolean | - |
modifiers
ordinations
| Name | Type | Description |
|---|---|---|
| direction | string | - |
| nulls | string | - |
| property | string | - |
pagination
| Name | Type | Description |
|---|---|---|
| page | integer | - |
| per_page | integer | - |
period
| Name | Type | Description |
|---|---|---|
| from | string | - |
| preset | string | - |
| to | string | - |
transformations
| Name | Type | Description |
|---|---|---|
| name | string | - |
| parameters | Array of Object | - |
Response
200
Successfully generated workload report
| Name | Type | Description |
|---|---|---|
| data_hierarchical | object | - |
| data_json_row | Array of object | - |
| data_table | object | - |
| dictionaries | object | - |
| total_count | integer | - |
data_hierarchical
data_json_row
dictionaries
| Name | Type | Description |
|---|---|---|
| clients | object | - |
| groups | object | - |
| projects | object | - |
| status | object | - |
| tags | object | - |
| tasks | object | - |
| users | object | - |
clients
groups
projects
status
tags
tasks
users
400
Invalid request parameters
500
Internal server error