Task-groups
GET Gets tasks in groups
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks/groups/{group}
Gets tasks in groups depending on name
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks/groups/{group} \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks/groups/{group}")
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/organizations/{organization_id}/workspaces/{workspace_id}/tasks/groups/{group}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Get.new(uri.path)
req['Content-Type'] = "application/json"
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks/groups/{group}", {
method: "GET",
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.get('https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks/groups/{group}', 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::GET, "https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks/groups/{group}".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| organization_id | integer | true | organization ID |
| workspace_id | integer | true | workspace ID |
| group | string | true | group name |
Query
| name | type | required | description |
|---|---|---|---|
| source | []string | false | filter by sources |
| priority | string | false | filter by priority |
| status_id | []integer | false | filter by statuses |
| project_id | []integer | false | filter by project IDs |
| client_id | []integer | false | filter by client IDs |
| assignee_user_id | []integer | false | filter by assignee user IDs |
| tag_id | []integer | false | filter by tag IDs |
| team_id | []integer | false | filter by team IDs (resolves to member user IDs) |
| group_id | []integer | false | filter by group IDs |
| creator_id | []integer | false | filter in by creator IDs |
| name | string | false | filter in by task name |
| start_date | string | false | filter tasks overlapping date range (start). Used with end_date to find tasks where task.start_date <= end_date AND task.end_date >= start_date |
| end_date | string | false | filter tasks overlapping date range (end). Used with start_date to find tasks where task.start_date <= end_date AND task.end_date >= start_date |
| start_date_from | string | false | [LEGACY] use start_date instead |
| start_date_to | string | false | [LEGACY] use start_date instead |
| end_date_from | string | false | [LEGACY] use end_date instead |
| end_date_to | string | false | [LEGACY] use end_date instead |
| private | boolean | false | filter by project privacy (true for private, false for public) |
| exclude_empty | boolean | false | filter groups with no tasks |
| include_ghosts | boolean | false | include ghost assignees in tasks, available for /users only |
| min_days | integer | false | filters tasks with a minimum number of days. based on start_date and end_date |
| page | integer | false | page number |
| per_page | integer | false | results per page |
| order_by | []string | false | order by |
Response
200
Tasks grouped by type
| Name | Type | Description |
|---|---|---|
| data | Array of object | - |
| page | integer | - |
| per_page | integer | - |
data
| Name | Type | Description |
|---|---|---|
| id | integer | The ID of one of the entities: projects/users determined by Type. |
| tasks | Array of object | The tasks that belong to the group. |
| type | string | Type determines what kind of group this is, and what table to look for based on ID. |
tasks
| Name | Type | Description |
|---|---|---|
| assignee_ghost_ids | Array of integer | - |
| assignee_user_ids | Array of integer | - |
| client | object | - |
| color | string | - |
| created_at | string | - |
| end_date | string | When a task ends |
| estimated_mins | integer | Estimated minutes of the task |
| id | integer | The task's ID |
| masked | boolean | Masked indicates the task belongs to a private project the user doesn't have access to. When true, sensitive fields (Name, Client) are nulled. |
| name | string | Name of the task |
| private | boolean | - |
| project | object | - |
| project_id | integer | Project ID fo the task |
| source | string | - |
| start_date | string | When a task starts |
| status_id | integer | Status ID of the task |
| weight | integer | The weight of a task in the timeline. This is not unique, and one or more tasks may have the same weight as long as their dates do not conflict. |
client
| Name | Type | Description |
|---|---|---|
| id | integer | - |
| name | string | - |
project
| Name | Type | Description |
|---|---|---|
| color | string | - |
| id | integer | - |
| name | string | - |
| permissions | Array of string | - |
| private | boolean | - |
| rate | object | - |
rate
| Name | Type | Description |
|---|---|---|
| billable | boolean | - |
| currency | string | - |
| end_at | string | - |
| has_more_rates | boolean | - |
| hourly_rate | number | - |
| project_color | string | - |
| project_created_at | string | - |
| project_id | integer | - |
| project_name | string | - |
| project_rate_id | integer | - |
| start_at | string | - |
| workspace_rate_id | integer | - |
400
Invalid request
403
Insufficient permissions
500
Internal Server Error
PATCH Updates task groups and their entries' weights/parent group
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks/groups/{group}
Updates task groups and their entries' weights/parent group
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X PATCH https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks/groups/{group} \
-H "Content-Type: application/json" \
-d '[\{"end_date":"string","id":"integer","op":"string","source_group_id":"integer","start_date":"string","target_group_id":"integer","weight":"integer"\}]' \
-u <email>:<password>
bytes, err := json.Marshal('[\{"end_date":"string","id":"integer","op":"string","source_group_id":"integer","start_date":"string","target_group_id":"integer","weight":"integer"\}]')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodGet,
"https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks/groups/{group}", 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/organizations/{organization_id}/workspaces/{workspace_id}/tasks/groups/{group}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Patch.new(uri.path)
req['Content-Type'] = "application/json"
req.body = [\{"end_date":"string","id":"integer","op":"string","source_group_id":"integer","start_date":"string","target_group_id":"integer","weight":"integer"\}].to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks/groups/{group}", {
method: "PATCH",
body: [\{"end_date":"string","id":"integer","op":"string","source_group_id":"integer","start_date":"string","target_group_id":"integer","weight":"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.patch('https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks/groups/{group}', json=[\{"end_date":"string","id":"integer","op":"string","source_group_id":"integer","start_date":"string","target_group_id":"integer","weight":"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::PATCH, "https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/tasks/groups/{group}".to_string())
.json(&serde_json::json!([\{"end_date":"string","id":"integer","op":"string","source_group_id":"integer","start_date":"string","target_group_id":"integer","weight":"integer"\}]))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| organization_id | integer | true | organization ID |
| workspace_id | integer | true | workspace ID |
| group | string | true | group type |
Body
| Name | Type | Description |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| end_date | string | - |
| id | integer | - |
| op | string | - |
| source_group_id | integer | - |
| start_date | string | - |
| target_group_id | integer | - |
| weight | integer | - |
Response
200
OK
400
Invalid request
403
Insufficient permissions
500
Internal Server Error