Veljko
1
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/timesheet_setups
Create timesheet setups.
- 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::POST, "https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/timesheet_setups".to_string()).json(&serde_json::json!(\{"approver_id":"integer","approver_ids":[\{\}],"member_ids":[\{\}],"periodicity":"string","reminder_day":"string","reminder_time":"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 |
Numeric ID of the workspace |
Body
Name |
Type |
Description |
approver_id |
integer |
- |
approver_ids |
Array of integer |
- |
member_ids |
Array of integer |
- |
periodicity |
string |
- |
reminder_day |
string |
- |
reminder_time |
string |
- |
start_date |
string |
- |
Response
200
Name |
Type |
Description |
items |
Array of object |
- |
items
Name |
Type |
Description |
approver_id |
integer |
- |
approver_name |
string |
- |
approvers |
Array of object |
- |
end_date |
string |
- |
errors |
Array of object |
- |
id |
integer |
- |
member_id |
integer |
- |
member_name |
string |
- |
periodicity |
string |
- |
permissions |
string |
- |
reminder_day |
string |
- |
reminder_time |
string |
- |
start_date |
string |
- |
workspace_id |
integer |
- |
approvers
Name |
Type |
Description |
name |
string |
- |
user_id |
integer |
- |
errors
Name |
Type |
Description |
code |
string |
- |
message |
string |
- |
400
Possible error messages:
- Workspace not found
- Invalid user ID
- Too many user IDs
- Invalid date
- Invalid periodicity
- User not in workspace
- User is not an admin in the workspace
- Approver cannot be member
- Member already has a timesheet setup
402
Approvals are a premium feature
403
User does not have access to this resource
500
Internal Server Error