“Saved reports” Endpoints - POST Export CSV for saved report

https://api.track.toggl.com/reports/api/v3/shared/{report_token}.csv

Downloads a previously saved report in csv.

Authentication

A public report is accessible by anyone, a private one is only accessible by the report’s owner or workspace admin. If the criteria aren’t met it returns 403 status code.

Parameters

The report can be executed without parameters, and in this case the saved or default parameters will be used.

  • 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/reports/api/v3/shared/{report_token}.csv".to_string())  .header(CONTENT_TYPE, "application/json")  .send()  .await?  .json()  .await?;    println!("{:#?}", json);  Ok(())}

Response

200

Returns report information in csv form

400

Possible error messages:

  • report_type does not exist in params
  • The report period is not supported

401

Possible error messages:

  • Unable to extract authentication data
  • Incorrect username and/or password

403

Possible error messages:

  • Invalid token
  • Workspace was not found or the report’s owner is no longer active on it

404

Not found

500

parameter since is missing