Skip to content

Instantly share code, notes, and snippets.

@zupzup
Created October 29, 2020 13:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zupzup/7e5e1f8df24042e336651d50798930f6 to your computer and use it in GitHub Desktop.
Save zupzup/7e5e1f8df24042e336651d50798930f6 to your computer and use it in GitHub Desktop.
Timeular Public API reports 2
use tokio::fs;
async fn generate_report(token: &str) -> Result<(), Error> {
let resp = CLIENT
.get(&url(
"/report/2020-01-01T00:00:00.000/2020-12-31T23:59:59.999?timezone=Europe/Vienna",
))
.header("Authorization", auth(token))
.send()
.await?
.bytes()
.await?;
fs::write(REPORT_FILE, &resp).await?;
Ok(())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment