Working
GET Get working hours for organization user
https://focus.toggl.com/api/organizations/{organization_id}/workinghours/users/{user_id}
Returns working hours for organization user
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://focus.toggl.com/api/organizations/{organization_id}/workinghours/users/{user_id} \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://focus.toggl.com/api/organizations/{organization_id}/workinghours/users/{user_id}")
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}/workinghours/users/{user_id}')
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}/workinghours/users/{user_id}", {
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}/workinghours/users/{user_id}', 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}/workinghours/users/{user_id}".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 |
| user_id | integer | true | User ID |
Response
200
| Name | Type | Description |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| created_at | string | - |
| external_entity_id | integer | - |
| external_entity_type | string | - |
| organization_id | integer | - |
| starting_hours | number | - |
| updated_at | string | - |
| user_id | integer | - |
| weekday | integer | - |
| working_hour_id | integer | - |
| working_hours | number | - |
400
Invalid year
403
Forbidden
500
Internal Server Error
PUT Update working hours for the specified user
https://focus.toggl.com/api/organizations/{organization_id}/workinghours/users/{user_id}
Updates working hours for the specified user
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X PUT https://focus.toggl.com/api/organizations/{organization_id}/workinghours/users/{user_id} \
-H "Content-Type: application/json" \
-d '[\{"weekday":"integer","working_hour_id":"integer","working_hours":"number"\}]' \
-u <email>:<password>
bytes, err := json.Marshal('[\{"weekday":"integer","working_hour_id":"integer","working_hours":"number"\}]')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPut,
"https://focus.toggl.com/api/organizations/{organization_id}/workinghours/users/{user_id}", 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}/workinghours/users/{user_id}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Put.new(uri.path)
req['Content-Type'] = "application/json"
req.body = [\{"weekday":"integer","working_hour_id":"integer","working_hours":"number"\}].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}/workinghours/users/{user_id}", {
method: "PUT",
body: [\{"weekday":"integer","working_hour_id":"integer","working_hours":"number"\}],
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.put('https://focus.toggl.com/api/organizations/{organization_id}/workinghours/users/{user_id}', json=[\{"weekday":"integer","working_hour_id":"integer","working_hours":"number"\}], 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::PUT, "https://focus.toggl.com/api/organizations/{organization_id}/workinghours/users/{user_id}".to_string())
.json(&serde_json::json!([\{"weekday":"integer","working_hour_id":"integer","working_hours":"number"\}]))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| organization_id | integer | true | Organization ID |
| user_id | integer | true | User ID |
Body
| Name | Type | Description |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| weekday | integer | - |
| working_hour_id | integer | - |
| working_hours | number | - |
Response
200
| Name | Type | Description |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| created_at | string | - |
| external_entity_id | integer | - |
| external_entity_type | string | - |
| organization_id | integer | - |
| starting_hours | number | - |
| updated_at | string | - |
| user_id | integer | - |
| weekday | integer | - |
| working_hour_id | integer | - |
| working_hours | number | - |
400
Invalid year
403
Forbidden
500
Internal Server Error
POST Create working hours for the specified user
https://focus.toggl.com/api/organizations/{organization_id}/workinghours/users/{user_id}
Creates working hours for the specified user
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://focus.toggl.com/api/organizations/{organization_id}/workinghours/users/{user_id} \
-H "Content-Type: application/json" \
-d '[\{"weekday":"integer","working_hours":"number"\}]' \
-u <email>:<password>
bytes, err := json.Marshal('[\{"weekday":"integer","working_hours":"number"\}]')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://focus.toggl.com/api/organizations/{organization_id}/workinghours/users/{user_id}", 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}/workinghours/users/{user_id}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
req.body = [\{"weekday":"integer","working_hours":"number"\}].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}/workinghours/users/{user_id}", {
method: "POST",
body: [\{"weekday":"integer","working_hours":"number"\}],
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/organizations/{organization_id}/workinghours/users/{user_id}', json=[\{"weekday":"integer","working_hours":"number"\}], 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/organizations/{organization_id}/workinghours/users/{user_id}".to_string())
.json(&serde_json::json!([\{"weekday":"integer","working_hours":"number"\}]))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| organization_id | integer | true | Organization ID |
| user_id | integer | true | User ID |
Body
| Name | Type | Description |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| weekday | integer | - |
| working_hours | number | - |
Response
200
| Name | Type | Description |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| created_at | string | - |
| external_entity_id | integer | - |
| external_entity_type | string | - |
| organization_id | integer | - |
| starting_hours | number | - |
| updated_at | string | - |
| user_id | integer | - |
| weekday | integer | - |
| working_hour_id | integer | - |
| working_hours | number | - |
400
Invalid year
403
Forbidden
500
Internal Server Error
DELETE Delete working hours for the specified user
https://focus.toggl.com/api/organizations/{organization_id}/workinghours/users/{user_id}
Deletes working hours for the specified user
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X DELETE https://focus.toggl.com/api/organizations/{organization_id}/workinghours/users/{user_id} \
-H "Content-Type: application/json" \
-d '[\{\}]' \
-u <email>:<password>
bytes, err := json.Marshal('[\{\}]')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPut,
"https://focus.toggl.com/api/organizations/{organization_id}/workinghours/users/{user_id}", 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}/workinghours/users/{user_id}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Delete.new(uri.path)
req['Content-Type'] = "application/json"
req.body = [\{\}].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}/workinghours/users/{user_id}", {
method: "DELETE",
body: [\{\}],
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.delete('https://focus.toggl.com/api/organizations/{organization_id}/workinghours/users/{user_id}', json=[\{\}], 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::DELETE, "https://focus.toggl.com/api/organizations/{organization_id}/workinghours/users/{user_id}".to_string())
.json(&serde_json::json!([\{\}]))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| organization_id | integer | true | Organization ID |
| user_id | integer | true | User ID |
Body
| Name | Type | Description |
|---|---|---|
| items | Array of integer | - |
Response
204
No Content
400
Invalid year
403
Forbidden
500
Internal Server Error
GET Get working hours for organization resouce/ghost
https://focus.toggl.com/api/organizations/{organization_id}/{workspace_id}/workinghours/ghosts/{ghost_id}
Returns working hours for organization resource/ghost
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://focus.toggl.com/api/organizations/{organization_id}/{workspace_id}/workinghours/ghosts/{ghost_id} \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://focus.toggl.com/api/organizations/{organization_id}/{workspace_id}/workinghours/ghosts/{ghost_id}")
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}/{workspace_id}/workinghours/ghosts/{ghost_id}')
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}/{workspace_id}/workinghours/ghosts/{ghost_id}", {
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}/{workspace_id}/workinghours/ghosts/{ghost_id}', 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}/{workspace_id}/workinghours/ghosts/{ghost_id}".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 |
| ghost_id | integer | true | Ghost ID |
Response
200
| Name | Type | Description |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| created_at | string | - |
| external_entity_id | integer | - |
| external_entity_type | string | - |
| organization_id | integer | - |
| starting_hours | number | - |
| updated_at | string | - |
| user_id | integer | - |
| weekday | integer | - |
| working_hour_id | integer | - |
| working_hours | number | - |
400
Invalid year
403
Forbidden
500
Internal Server Error
PUT Update working hours for the specified ghost
https://focus.toggl.com/api/organizations/{organization_id}/{workspace_id}/workinghours/ghosts/{ghost_id}
Updates working hours for the specified ghost
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X PUT https://focus.toggl.com/api/organizations/{organization_id}/{workspace_id}/workinghours/ghosts/{ghost_id} \
-H "Content-Type: application/json" \
-d '[\{"weekday":"integer","working_hour_id":"integer","working_hours":"number"\}]' \
-u <email>:<password>
bytes, err := json.Marshal('[\{"weekday":"integer","working_hour_id":"integer","working_hours":"number"\}]')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPut,
"https://focus.toggl.com/api/organizations/{organization_id}/{workspace_id}/workinghours/ghosts/{ghost_id}", 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}/{workspace_id}/workinghours/ghosts/{ghost_id}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Put.new(uri.path)
req['Content-Type'] = "application/json"
req.body = [\{"weekday":"integer","working_hour_id":"integer","working_hours":"number"\}].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}/{workspace_id}/workinghours/ghosts/{ghost_id}", {
method: "PUT",
body: [\{"weekday":"integer","working_hour_id":"integer","working_hours":"number"\}],
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.put('https://focus.toggl.com/api/organizations/{organization_id}/{workspace_id}/workinghours/ghosts/{ghost_id}', json=[\{"weekday":"integer","working_hour_id":"integer","working_hours":"number"\}], 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::PUT, "https://focus.toggl.com/api/organizations/{organization_id}/{workspace_id}/workinghours/ghosts/{ghost_id}".to_string())
.json(&serde_json::json!([\{"weekday":"integer","working_hour_id":"integer","working_hours":"number"\}]))
.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 |
| ghost_id | integer | true | Ghost ID |
Body
| Name | Type | Description |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| weekday | integer | - |
| working_hour_id | integer | - |
| working_hours | number | - |
Response
200
| Name | Type | Description |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| created_at | string | - |
| external_entity_id | integer | - |
| external_entity_type | string | - |
| organization_id | integer | - |
| starting_hours | number | - |
| updated_at | string | - |
| user_id | integer | - |
| weekday | integer | - |
| working_hour_id | integer | - |
| working_hours | number | - |
400
Invalid year
403
Forbidden
500
Internal Server Error
POST Create working hours for the specified ghost
https://focus.toggl.com/api/organizations/{organization_id}/{workspace_id}/workinghours/ghosts/{ghost_id}
Creates working hours for the specified ghost
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://focus.toggl.com/api/organizations/{organization_id}/{workspace_id}/workinghours/ghosts/{ghost_id} \
-H "Content-Type: application/json" \
-d '[\{"weekday":"integer","working_hours":"number"\}]' \
-u <email>:<password>
bytes, err := json.Marshal('[\{"weekday":"integer","working_hours":"number"\}]')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPost,
"https://focus.toggl.com/api/organizations/{organization_id}/{workspace_id}/workinghours/ghosts/{ghost_id}", 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}/{workspace_id}/workinghours/ghosts/{ghost_id}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.new(uri.path)
req['Content-Type'] = "application/json"
req.body = [\{"weekday":"integer","working_hours":"number"\}].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}/{workspace_id}/workinghours/ghosts/{ghost_id}", {
method: "POST",
body: [\{"weekday":"integer","working_hours":"number"\}],
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/organizations/{organization_id}/{workspace_id}/workinghours/ghosts/{ghost_id}', json=[\{"weekday":"integer","working_hours":"number"\}], 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/organizations/{organization_id}/{workspace_id}/workinghours/ghosts/{ghost_id}".to_string())
.json(&serde_json::json!([\{"weekday":"integer","working_hours":"number"\}]))
.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 |
| ghost_id | integer | true | Ghost ID |
Body
| Name | Type | Description |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| weekday | integer | - |
| working_hours | number | - |
Response
200
| Name | Type | Description |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| created_at | string | - |
| external_entity_id | integer | - |
| external_entity_type | string | - |
| organization_id | integer | - |
| starting_hours | number | - |
| updated_at | string | - |
| user_id | integer | - |
| weekday | integer | - |
| working_hour_id | integer | - |
| working_hours | number | - |
400
Invalid year
403
Forbidden
500
Internal Server Error
DELETE Delete working hours for the specified ghost
https://focus.toggl.com/api/organizations/{organization_id}/{workspace_id}/workinghours/ghosts/{ghost_id}
Deletes working hours for the specified ghost
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X DELETE https://focus.toggl.com/api/organizations/{organization_id}/{workspace_id}/workinghours/ghosts/{ghost_id} \
-H "Content-Type: application/json" \
-d '[\{\}]' \
-u <email>:<password>
bytes, err := json.Marshal('[\{\}]')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPut,
"https://focus.toggl.com/api/organizations/{organization_id}/{workspace_id}/workinghours/ghosts/{ghost_id}", 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}/{workspace_id}/workinghours/ghosts/{ghost_id}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Delete.new(uri.path)
req['Content-Type'] = "application/json"
req.body = [\{\}].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}/{workspace_id}/workinghours/ghosts/{ghost_id}", {
method: "DELETE",
body: [\{\}],
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.delete('https://focus.toggl.com/api/organizations/{organization_id}/{workspace_id}/workinghours/ghosts/{ghost_id}', json=[\{\}], 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::DELETE, "https://focus.toggl.com/api/organizations/{organization_id}/{workspace_id}/workinghours/ghosts/{ghost_id}".to_string())
.json(&serde_json::json!([\{\}]))
.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 |
| ghost_id | integer | true | Ghost ID |
Body
| Name | Type | Description |
|---|---|---|
| items | Array of integer | - |
Response
204
No Content
400
Invalid year
403
Forbidden
500
Internal Server Error