https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/rates/{level}/{level_id}
Get rates by level(workspace|project|task|user).
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
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://api.track.toggl.com/api/v9/workspaces/{workspace_id}/rates/{level}/{level_id}".to_string()) .header(CONTENT_TYPE, "application/json") .send() .await? .json() .await?; println!("{:#?}", json); Ok(())}
Parameters
Path
name | type | required | description |
---|---|---|---|
workspace_id | integer | true | Numeric ID of the workspace |
level | string | true | Rates level: workspace, project, task or user |
level_id | integer | true | Numeric ID of the entity level |
Query
name | type | required | description |
---|---|---|---|
type | string | false | Type of rate values to be returned: billable_rates or labor_costs . Default is billable_rates . |
Response
200
Name | Type | Description |
---|---|---|
items | Array of object | - |
items
Name | Type | Description |
---|---|---|
amount | number | Amount of the rate |
created_at | string | Creation date of the rate |
creatorID | integer | - |
deleted_at | string | Deletion date of the rate, in case that is null it means the rates is active |
end | string | End date time of the rate |
id | integer | Identifier of the rate |
planned_task_id | integer | Planned task ID which the rate is applied |
project_id | integer | Project ID which the rate is applied |
project_user_id | integer | Project user ID which the rate is applied |
start | string | Start date time of the rate |
type | string | - |
updated_at | string | Last update date of the rate |
workspace_id | integer | Workspace ID which the rate is applied |
workspace_user_id | integer | Workspace user ID which the rate is applied |
400
Possible error messages:
- Invalid workspace ID
- Invalid entity ID
- Invalid level: it should be workspace, workspace_user, project or project_user
- User not found in workspace
- Task not found in workspace
402
Billable rates are available for Starter and higher plans.
403
User cannot access billable rate(s).
500
Internal Server Error