Capacities
GET /organizations/{organization_id}/workspaces/{workspace_id}/capacities/{group}
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/capacities/{group}
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/capacities/{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}/capacities/{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}/capacities/{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}/capacities/{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}/capacities/{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}/capacities/{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 of computations |
Query
| name | type | required | description |
|---|---|---|---|
| user_id | []integer | true | get capacity computations for the user given their ID |
| ghost_id | []integer | false | get capacity computations for the resource/ghost given their ID |
| start_date | string | true | start date of computation |
| end_date | string | true | end date of computation |
| private | boolean | false | task privacy used to compute for capacity |
| task_source | []string | false | filter task sources |
| unit | string | false | unit of time for computation. default: day |
Response
200
Computations grouped
| Name | Type | Description |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| computations | Array of object | The computations that belong to the grouping entity |
| id | integer | The ID of the entity that groups the computations |
| type | string | The type of the entity that groups the computations |
computations
| Name | Type | Description |
|---|---|---|
| allocated_minutes | number | The summation of a user's time blocked minutes in the day |
| assigned_tasks_count | integer | Number of tasks assigned to the user on the specified Date |
| date | string | The date of the computation |
| estimated_minutes | integer | The summation of a user's tasks' estimated minutes in the day |
| working_minutes | integer | The user's per day working minutes set in their user preferences |
400
Invalid request
403
Insufficient permissions
500
Internal Server Error