Calendar
GET List calendar integrations
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/integrations/calendar
List calendar integrations, i.e. the email accounts connected.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/integrations/calendar \
-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}/integrations/calendar")
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}/integrations/calendar')
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}/integrations/calendar", {
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}/integrations/calendar', 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}/integrations/calendar".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 |
Response
200
List of integrations, aka connected emails
| Name | Type | Description |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| auto_track | boolean | - |
| calendar_integration_id | integer | - |
| calendars | Array of object | - |
| created_at | string | - |
| string | - | |
| error_status | string | - |
| has_write_scope | boolean | - |
| origin_product_id | integer | The product that initially integrated the calendar. |
| provider | string | - |
| scopes | Array of string | - |
calendars
| Name | Type | Description |
|---|---|---|
| background_color | string | - |
| calendar_id | integer | - |
| calendar_integration_id | integer | - |
| created_at | string | - |
| default_planned_task_id | integer | - |
| default_project_id | integer | - |
| default_workspace_id | integer | - |
| deleted_at | string | - |
| external_id | string | - |
| foreground_color | string | - |
| name | string | - |
| remind_tracking | boolean | The following fields are deprecated but we need to keep them for backward compatibility with previous versions of mobile apps |
| selected | boolean | - |
| updated_at | string | - |
400
Invalid request
500
Internal Server Error
GET Setup calendar integration
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/integrations/calendar/setup
Connect a new calendar integration.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/integrations/calendar/setup \
-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}/integrations/calendar/setup")
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}/integrations/calendar/setup')
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}/integrations/calendar/setup", {
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}/integrations/calendar/setup', 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}/integrations/calendar/setup".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 |
Query
| name | type | required | description |
|---|---|---|---|
| provider | string | true | Calendar service provider which the calendars will be retrieved |
| return_to | string | false | Page to which the user will be redirected after authenticating |
Response
302
Redirect to oAuth URL
400
Invalid request
402
status payment required: integration already exists
500
Internal Server Error
GET List calendars for a particular integration
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/integrations/calendar/{integration_id}
List calendars for a particular integration, i.e. the calendars available from the connected account.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/integrations/calendar/{integration_id} \
-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}/integrations/calendar/{integration_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}/workspaces/{workspace_id}/integrations/calendar/{integration_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}/workspaces/{workspace_id}/integrations/calendar/{integration_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}/workspaces/{workspace_id}/integrations/calendar/{integration_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}/workspaces/{workspace_id}/integrations/calendar/{integration_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 |
| integration_id | integer | true | integration ID |
Response
200
List of calendars
| Name | Type | Description |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| background_color | string | - |
| calendar_id | integer | - |
| calendar_integration_id | integer | - |
| created_at | string | - |
| default_planned_task_id | integer | - |
| default_project_id | integer | - |
| default_workspace_id | integer | - |
| deleted_at | string | - |
| external_id | string | - |
| foreground_color | string | - |
| name | string | - |
| remind_tracking | boolean | The following fields are deprecated but we need to keep them for backward compatibility with previous versions of mobile apps |
| selected | boolean | - |
| updated_at | string | - |
400
Invalid request
500
Internal Server Error
DELETE Delete a calendar integration
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/integrations/calendar/{integration_id}
Delete a calendar integration.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X DELETE https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/integrations/calendar/{integration_id} \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodPut,
"https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/integrations/calendar/{integration_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}/workspaces/{workspace_id}/integrations/calendar/{integration_id}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Delete.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}/integrations/calendar/{integration_id}", {
method: "DELETE",
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}/workspaces/{workspace_id}/integrations/calendar/{integration_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::DELETE, "https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/integrations/calendar/{integration_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 |
| integration_id | integer | true | integration ID |
Response
200
List of calendars
| Name | Type | Description |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| background_color | string | - |
| calendar_id | integer | - |
| calendar_integration_id | integer | - |
| created_at | string | - |
| default_planned_task_id | integer | - |
| default_project_id | integer | - |
| default_workspace_id | integer | - |
| deleted_at | string | - |
| external_id | string | - |
| foreground_color | string | - |
| name | string | - |
| remind_tracking | boolean | The following fields are deprecated but we need to keep them for backward compatibility with previous versions of mobile apps |
| selected | boolean | - |
| updated_at | string | - |
400
Invalid request
500
Internal Server Error
PUT Update calendar integration
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/integrations/calendar/{integration_id}/calendars/{calendar_id}
Update calendar integration.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X PUT https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/integrations/calendar/{integration_id}/calendars/{calendar_id} \
-H "Content-Type: application/json" \
-d '\{"background_color":"string","calendar_id":"integer","calendar_integration_id":"integer","created_at":"string","default_planned_task_id":"integer","default_project_id":"integer","default_workspace_id":"integer","deleted_at":"string","external_id":"string","foreground_color":"string","name":"string","remind_tracking":"boolean","selected":"boolean","updated_at":"string"\}' \
-u <email>:<password>
bytes, err := json.Marshal('\{"background_color":"string","calendar_id":"integer","calendar_integration_id":"integer","created_at":"string","default_planned_task_id":"integer","default_project_id":"integer","default_workspace_id":"integer","deleted_at":"string","external_id":"string","foreground_color":"string","name":"string","remind_tracking":"boolean","selected":"boolean","updated_at":"string"\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPut,
"https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/integrations/calendar/{integration_id}/calendars/{calendar_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}/workspaces/{workspace_id}/integrations/calendar/{integration_id}/calendars/{calendar_id}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Put.new(uri.path)
req['Content-Type'] = "application/json"
req.body = \{"background_color":"string","calendar_id":"integer","calendar_integration_id":"integer","created_at":"string","default_planned_task_id":"integer","default_project_id":"integer","default_workspace_id":"integer","deleted_at":"string","external_id":"string","foreground_color":"string","name":"string","remind_tracking":"boolean","selected":"boolean","updated_at":"string"\}.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}/integrations/calendar/{integration_id}/calendars/{calendar_id}", {
method: "PUT",
body: \{"background_color":"string","calendar_id":"integer","calendar_integration_id":"integer","created_at":"string","default_planned_task_id":"integer","default_project_id":"integer","default_workspace_id":"integer","deleted_at":"string","external_id":"string","foreground_color":"string","name":"string","remind_tracking":"boolean","selected":"boolean","updated_at":"string"\},
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}/workspaces/{workspace_id}/integrations/calendar/{integration_id}/calendars/{calendar_id}', json=\{"background_color":"string","calendar_id":"integer","calendar_integration_id":"integer","created_at":"string","default_planned_task_id":"integer","default_project_id":"integer","default_workspace_id":"integer","deleted_at":"string","external_id":"string","foreground_color":"string","name":"string","remind_tracking":"boolean","selected":"boolean","updated_at":"string"\}, 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}/workspaces/{workspace_id}/integrations/calendar/{integration_id}/calendars/{calendar_id}".to_string())
.json(&serde_json::json!(\{"background_color":"string","calendar_id":"integer","calendar_integration_id":"integer","created_at":"string","default_planned_task_id":"integer","default_project_id":"integer","default_workspace_id":"integer","deleted_at":"string","external_id":"string","foreground_color":"string","name":"string","remind_tracking":"boolean","selected":"boolean","updated_at":"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 |
| integration_id | integer | true | integration ID |
| calendar_id | integer | true | calendar ID |
Body
| Name | Type | Description |
|---|---|---|
| background_color | string | - |
| calendar_id | integer | - |
| calendar_integration_id | integer | - |
| created_at | string | - |
| default_planned_task_id | integer | - |
| default_project_id | integer | - |
| default_workspace_id | integer | - |
| deleted_at | string | - |
| external_id | string | - |
| foreground_color | string | - |
| name | string | - |
| remind_tracking | boolean | The following fields are deprecated but we need to keep them for backward compatibility with previous versions of mobile apps |
| selected | boolean | - |
| updated_at | string | - |
Response
200
List of calendars
| Name | Type | Description |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| background_color | string | - |
| calendar_id | integer | - |
| calendar_integration_id | integer | - |
| created_at | string | - |
| default_planned_task_id | integer | - |
| default_project_id | integer | - |
| default_workspace_id | integer | - |
| deleted_at | string | - |
| external_id | string | - |
| foreground_color | string | - |
| name | string | - |
| remind_tracking | boolean | The following fields are deprecated but we need to keep them for backward compatibility with previous versions of mobile apps |
| selected | boolean | - |
| updated_at | string | - |
400
Invalid request
500
Internal Server Error
GET Request write scope.
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/integrations/calendar/{integration_id}/reauth
Increment the user's oauth scope for write capabilities
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/integrations/calendar/{integration_id}/reauth \
-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}/integrations/calendar/{integration_id}/reauth")
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}/integrations/calendar/{integration_id}/reauth')
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}/integrations/calendar/{integration_id}/reauth", {
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}/integrations/calendar/{integration_id}/reauth', 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}/integrations/calendar/{integration_id}/reauth".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 |
| integration_id | integer | true | integration ID |
Query
| name | type | required | description |
|---|---|---|---|
| return_to | string | true | Page to which the user will be redirected after authenticating |
Response
302
Redirect to oAuth URL
400
Invalid request
404
Integration not found
500
Internal Server Error
POST Update integration
https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/integrations/calendar/{integration_id}/update
Update integration.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/integrations/calendar/{integration_id}/update \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodPost,
"https://focus.toggl.com/api/organizations/{organization_id}/workspaces/{workspace_id}/integrations/calendar/{integration_id}/update")
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}/integrations/calendar/{integration_id}/update')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.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}/integrations/calendar/{integration_id}/update", {
method: "POST",
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}/workspaces/{workspace_id}/integrations/calendar/{integration_id}/update', 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}/workspaces/{workspace_id}/integrations/calendar/{integration_id}/update".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 |
| integration_id | integer | true | integration ID |
Response
200
List of calendars
| Name | Type | Description |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| background_color | string | - |
| calendar_id | integer | - |
| calendar_integration_id | integer | - |
| created_at | string | - |
| default_planned_task_id | integer | - |
| default_project_id | integer | - |
| default_workspace_id | integer | - |
| deleted_at | string | - |
| external_id | string | - |
| foreground_color | string | - |
| name | string | - |
| remind_tracking | boolean | The following fields are deprecated but we need to keep them for backward compatibility with previous versions of mobile apps |
| selected | boolean | - |
| updated_at | string | - |
400
Invalid request
500
Internal Server Error
GET List calendar integrations
https://focus.toggl.com/api/workspaces/{workspace_id}/integrations/calendar
List calendar integrations, i.e. the email accounts connected.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://focus.toggl.com/api/workspaces/{workspace_id}/integrations/calendar \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://focus.toggl.com/api/workspaces/{workspace_id}/integrations/calendar")
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/workspaces/{workspace_id}/integrations/calendar')
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/workspaces/{workspace_id}/integrations/calendar", {
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/workspaces/{workspace_id}/integrations/calendar', 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/workspaces/{workspace_id}/integrations/calendar".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| workspace_id | integer | true | workspace ID |
Response
200
List of integrations, aka connected emails
| Name | Type | Description |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| auto_track | boolean | - |
| calendar_integration_id | integer | - |
| calendars | Array of object | - |
| created_at | string | - |
| string | - | |
| error_status | string | - |
| has_write_scope | boolean | - |
| origin_product_id | integer | The product that initially integrated the calendar. |
| provider | string | - |
| scopes | Array of string | - |
calendars
| Name | Type | Description |
|---|---|---|
| background_color | string | - |
| calendar_id | integer | - |
| calendar_integration_id | integer | - |
| created_at | string | - |
| default_planned_task_id | integer | - |
| default_project_id | integer | - |
| default_workspace_id | integer | - |
| deleted_at | string | - |
| external_id | string | - |
| foreground_color | string | - |
| name | string | - |
| remind_tracking | boolean | The following fields are deprecated but we need to keep them for backward compatibility with previous versions of mobile apps |
| selected | boolean | - |
| updated_at | string | - |
400
Invalid request
500
Internal Server Error
GET Setup calendar integration
https://focus.toggl.com/api/workspaces/{workspace_id}/integrations/calendar/setup
Connect a new calendar integration.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://focus.toggl.com/api/workspaces/{workspace_id}/integrations/calendar/setup \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://focus.toggl.com/api/workspaces/{workspace_id}/integrations/calendar/setup")
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/workspaces/{workspace_id}/integrations/calendar/setup')
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/workspaces/{workspace_id}/integrations/calendar/setup", {
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/workspaces/{workspace_id}/integrations/calendar/setup', 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/workspaces/{workspace_id}/integrations/calendar/setup".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| workspace_id | integer | true | workspace ID |
Query
| name | type | required | description |
|---|---|---|---|
| provider | string | true | Calendar service provider which the calendars will be retrieved |
| return_to | string | false | Page to which the user will be redirected after authenticating |
Response
302
Redirect to oAuth URL
400
Invalid request
402
status payment required: integration already exists
500
Internal Server Error
GET List calendars for a particular integration
https://focus.toggl.com/api/workspaces/{workspace_id}/integrations/calendar/{integration_id}
List calendars for a particular integration, i.e. the calendars available from the connected account.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://focus.toggl.com/api/workspaces/{workspace_id}/integrations/calendar/{integration_id} \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://focus.toggl.com/api/workspaces/{workspace_id}/integrations/calendar/{integration_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/workspaces/{workspace_id}/integrations/calendar/{integration_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/workspaces/{workspace_id}/integrations/calendar/{integration_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/workspaces/{workspace_id}/integrations/calendar/{integration_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/workspaces/{workspace_id}/integrations/calendar/{integration_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 | workspace ID |
| integration_id | integer | true | integration ID |
Response
200
List of calendars
| Name | Type | Description |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| background_color | string | - |
| calendar_id | integer | - |
| calendar_integration_id | integer | - |
| created_at | string | - |
| default_planned_task_id | integer | - |
| default_project_id | integer | - |
| default_workspace_id | integer | - |
| deleted_at | string | - |
| external_id | string | - |
| foreground_color | string | - |
| name | string | - |
| remind_tracking | boolean | The following fields are deprecated but we need to keep them for backward compatibility with previous versions of mobile apps |
| selected | boolean | - |
| updated_at | string | - |
400
Invalid request
500
Internal Server Error
DELETE Delete a calendar integration
https://focus.toggl.com/api/workspaces/{workspace_id}/integrations/calendar/{integration_id}
Delete a calendar integration.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X DELETE https://focus.toggl.com/api/workspaces/{workspace_id}/integrations/calendar/{integration_id} \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodPut,
"https://focus.toggl.com/api/workspaces/{workspace_id}/integrations/calendar/{integration_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/workspaces/{workspace_id}/integrations/calendar/{integration_id}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Delete.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/workspaces/{workspace_id}/integrations/calendar/{integration_id}", {
method: "DELETE",
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/workspaces/{workspace_id}/integrations/calendar/{integration_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::DELETE, "https://focus.toggl.com/api/workspaces/{workspace_id}/integrations/calendar/{integration_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 | workspace ID |
| integration_id | integer | true | integration ID |
Response
200
List of calendars
| Name | Type | Description |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| background_color | string | - |
| calendar_id | integer | - |
| calendar_integration_id | integer | - |
| created_at | string | - |
| default_planned_task_id | integer | - |
| default_project_id | integer | - |
| default_workspace_id | integer | - |
| deleted_at | string | - |
| external_id | string | - |
| foreground_color | string | - |
| name | string | - |
| remind_tracking | boolean | The following fields are deprecated but we need to keep them for backward compatibility with previous versions of mobile apps |
| selected | boolean | - |
| updated_at | string | - |
400
Invalid request
500
Internal Server Error
PUT Update calendar integration
https://focus.toggl.com/api/workspaces/{workspace_id}/integrations/calendar/{integration_id}/calendars/{calendar_id}
Update calendar integration.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X PUT https://focus.toggl.com/api/workspaces/{workspace_id}/integrations/calendar/{integration_id}/calendars/{calendar_id} \
-H "Content-Type: application/json" \
-d '\{"background_color":"string","calendar_id":"integer","calendar_integration_id":"integer","created_at":"string","default_planned_task_id":"integer","default_project_id":"integer","default_workspace_id":"integer","deleted_at":"string","external_id":"string","foreground_color":"string","name":"string","remind_tracking":"boolean","selected":"boolean","updated_at":"string"\}' \
-u <email>:<password>
bytes, err := json.Marshal('\{"background_color":"string","calendar_id":"integer","calendar_integration_id":"integer","created_at":"string","default_planned_task_id":"integer","default_project_id":"integer","default_workspace_id":"integer","deleted_at":"string","external_id":"string","foreground_color":"string","name":"string","remind_tracking":"boolean","selected":"boolean","updated_at":"string"\}')
if err != nil {
print(err)
}
req, err := http.NewRequest(http.MethodPut,
"https://focus.toggl.com/api/workspaces/{workspace_id}/integrations/calendar/{integration_id}/calendars/{calendar_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/workspaces/{workspace_id}/integrations/calendar/{integration_id}/calendars/{calendar_id}')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Put.new(uri.path)
req['Content-Type'] = "application/json"
req.body = \{"background_color":"string","calendar_id":"integer","calendar_integration_id":"integer","created_at":"string","default_planned_task_id":"integer","default_project_id":"integer","default_workspace_id":"integer","deleted_at":"string","external_id":"string","foreground_color":"string","name":"string","remind_tracking":"boolean","selected":"boolean","updated_at":"string"\}.to_json
request.basic_auth '<email>', '<password>'
res = http.request(req)
puts JSON.parse(res.body)
fetch("https://focus.toggl.com/api/workspaces/{workspace_id}/integrations/calendar/{integration_id}/calendars/{calendar_id}", {
method: "PUT",
body: \{"background_color":"string","calendar_id":"integer","calendar_integration_id":"integer","created_at":"string","default_planned_task_id":"integer","default_project_id":"integer","default_workspace_id":"integer","deleted_at":"string","external_id":"string","foreground_color":"string","name":"string","remind_tracking":"boolean","selected":"boolean","updated_at":"string"\},
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/workspaces/{workspace_id}/integrations/calendar/{integration_id}/calendars/{calendar_id}', json=\{"background_color":"string","calendar_id":"integer","calendar_integration_id":"integer","created_at":"string","default_planned_task_id":"integer","default_project_id":"integer","default_workspace_id":"integer","deleted_at":"string","external_id":"string","foreground_color":"string","name":"string","remind_tracking":"boolean","selected":"boolean","updated_at":"string"\}, 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/workspaces/{workspace_id}/integrations/calendar/{integration_id}/calendars/{calendar_id}".to_string())
.json(&serde_json::json!(\{"background_color":"string","calendar_id":"integer","calendar_integration_id":"integer","created_at":"string","default_planned_task_id":"integer","default_project_id":"integer","default_workspace_id":"integer","deleted_at":"string","external_id":"string","foreground_color":"string","name":"string","remind_tracking":"boolean","selected":"boolean","updated_at":"string"\}))
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| workspace_id | integer | true | workspace ID |
| integration_id | integer | true | integration ID |
| calendar_id | integer | true | calendar ID |
Body
| Name | Type | Description |
|---|---|---|
| background_color | string | - |
| calendar_id | integer | - |
| calendar_integration_id | integer | - |
| created_at | string | - |
| default_planned_task_id | integer | - |
| default_project_id | integer | - |
| default_workspace_id | integer | - |
| deleted_at | string | - |
| external_id | string | - |
| foreground_color | string | - |
| name | string | - |
| remind_tracking | boolean | The following fields are deprecated but we need to keep them for backward compatibility with previous versions of mobile apps |
| selected | boolean | - |
| updated_at | string | - |
Response
200
List of calendars
| Name | Type | Description |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| background_color | string | - |
| calendar_id | integer | - |
| calendar_integration_id | integer | - |
| created_at | string | - |
| default_planned_task_id | integer | - |
| default_project_id | integer | - |
| default_workspace_id | integer | - |
| deleted_at | string | - |
| external_id | string | - |
| foreground_color | string | - |
| name | string | - |
| remind_tracking | boolean | The following fields are deprecated but we need to keep them for backward compatibility with previous versions of mobile apps |
| selected | boolean | - |
| updated_at | string | - |
400
Invalid request
500
Internal Server Error
GET Request write scope.
https://focus.toggl.com/api/workspaces/{workspace_id}/integrations/calendar/{integration_id}/reauth
Increment the user's oauth scope for write capabilities
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl https://focus.toggl.com/api/workspaces/{workspace_id}/integrations/calendar/{integration_id}/reauth \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodGet,
"https://focus.toggl.com/api/workspaces/{workspace_id}/integrations/calendar/{integration_id}/reauth")
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/workspaces/{workspace_id}/integrations/calendar/{integration_id}/reauth')
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/workspaces/{workspace_id}/integrations/calendar/{integration_id}/reauth", {
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/workspaces/{workspace_id}/integrations/calendar/{integration_id}/reauth', 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/workspaces/{workspace_id}/integrations/calendar/{integration_id}/reauth".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| workspace_id | integer | true | workspace ID |
| integration_id | integer | true | integration ID |
Query
| name | type | required | description |
|---|---|---|---|
| return_to | string | true | Page to which the user will be redirected after authenticating |
Response
302
Redirect to oAuth URL
400
Invalid request
404
Integration not found
500
Internal Server Error
POST Update integration
https://focus.toggl.com/api/workspaces/{workspace_id}/integrations/calendar/{integration_id}/update
Update integration.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
curl -X POST https://focus.toggl.com/api/workspaces/{workspace_id}/integrations/calendar/{integration_id}/update \
-H "Content-Type: application/json" \
-u <email>:<password>
req, err := http.NewRequest(http.MethodPost,
"https://focus.toggl.com/api/workspaces/{workspace_id}/integrations/calendar/{integration_id}/update")
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/workspaces/{workspace_id}/integrations/calendar/{integration_id}/update')
http = Net::HTTP.new(uri.host, uri.port)
req = Net::HTTP::Post.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/workspaces/{workspace_id}/integrations/calendar/{integration_id}/update", {
method: "POST",
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/workspaces/{workspace_id}/integrations/calendar/{integration_id}/update', 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/workspaces/{workspace_id}/integrations/calendar/{integration_id}/update".to_string())
.header(CONTENT_TYPE, "application/json")
.send()
.await?
.json()
.await?;
println!("{:#?}", json);
Ok(())
}
Parameters
Path
| name | type | required | description |
|---|---|---|---|
| workspace_id | integer | true | workspace ID |
| integration_id | integer | true | integration ID |
Response
200
List of calendars
| Name | Type | Description |
|---|---|---|
| items | Array of object | - |
items
| Name | Type | Description |
|---|---|---|
| background_color | string | - |
| calendar_id | integer | - |
| calendar_integration_id | integer | - |
| created_at | string | - |
| default_planned_task_id | integer | - |
| default_project_id | integer | - |
| default_workspace_id | integer | - |
| deleted_at | string | - |
| external_id | string | - |
| foreground_color | string | - |
| name | string | - |
| remind_tracking | boolean | The following fields are deprecated but we need to keep them for backward compatibility with previous versions of mobile apps |
| selected | boolean | - |
| updated_at | string | - |
400
Invalid request
500
Internal Server Error