Skip to content

Instantly share code, notes, and snippets.

@zupzup
Created December 2, 2020 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zupzup/6187cfe905ca9e8f4b0f1464ab227304 to your computer and use it in GitHub Desktop.
Save zupzup/6187cfe905ca9e8f4b0f1464ab227304 to your computer and use it in GitHub Desktop.
Timeular Webhooks Events
#[derive(Deserialize, Debug)]
struct EventsResponse {
events: Vec<String>,
}
async fn fetch_events(token: &str) -> Result<Vec<String>, Error> {
let resp = CLIENT
.get(&url("/webhooks/event"))
.header("Authorization", auth(token))
.send()
.await?
.json::<EventsResponse>()
.await?;
Ok(resp.events)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment